en fait vb gère la couleur en RGB (red green blue) donc pour savoir ce ki est noir tu auras R=0 , G=0 et B=0 .....mais tu me diras surement..."euh moi j'ai une valeur en long.....je vois pa trop comment tu peux obtenir 3 valeur RGB...." et bien simplement en utilisant cette valeur en hexdecimal....
tu peux trouver différente API ki peuvent t'aider pour le traitement de tes couleurs....
Public Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
et voici un class ke tu peux aisément utiliser pour gérer facilement le passage de couleur en valeur vers du RGB
Option Explicit
Dim ColorTmp As Long
Public Property Get Color() As Long
Color = ColorTmp
End Property
Public Property Let Color(ByVal vColor As Long)
ColorTmp = vColor
End Property
Public Property Get R() As Long
R = (((ColorTmp And 255) * 50) + ((ColorTmp And 255) * 50)) \ 100
End Property
Public Property Let R(ByVal vR As Long)
If vR > 255 Then vR = 255
If vR < 0 Then vR = 0
ColorTmp = RGB(vR, Me.G, Me.B)
End Property
Public Property Get G() As Long
G = ((((ColorTmp \ 256) And 255) * 50) + (((ColorTmp \ 256) And 255) * 50)) \ 100
End Property
Public Property Let G(ByVal vG As Long)
If vG > 255 Then vG = 255
If vG < 0 Then vG = 0
ColorTmp = RGB(Me.R, vG, Me.B)
End Property
Public Property Get B() As Long
B = ((((ColorTmp \ 65536) And 255) * 50) + (((ColorTmp \ 65536) And 255) * 50)) \ 100
End Property
Public Property Let B(ByVal vB As Long)
If vB > 255 Then vB = 255
If vB < 0 Then vB = 0
ColorTmp = RGB(Me.R, Me.G, vB)
End Property
Yomm >:)
[mailto:yommvb@ifrance.com yommvb@ifrance.com]
Et que la source soit avec toi!!!!!