Long nombre ver s RGB

ebwm - 24 janv. 2001 à 12:40
F_L Messages postés 5 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 17 août 2004 - 15 févr. 2004 à 16:42
bonjour
quand on fait un source.backcolor (par exemple) on obtient un nombre du genre 9459964, comment convertir ce nombre en RGB ou HEX (rgb(252,84,144) ou #FC5890)?
merci

2 réponses

Net1dsang Messages postés 35 Date d'inscription jeudi 10 avril 2003 Statut Membre Dernière intervention 11 août 2010
6 mai 2003 à 16:46
je me pose exactement la meme kestion !! qq'un pour nous aider ?
0
F_L Messages postés 5 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 17 août 2004
15 févr. 2004 à 16:42
C'est tout simple :

Public Function GetR(col As Long) As Byte
'pour le rouge
GetR = col And &HFF&
End Function

Public Function GetG(col As Long) As Byte
'Pour le vert
GetG = (col And &HFF00&) / &H100&
End Function

Public Function GetB(col As Long) As Byte
'Pour le bleu
GetB = (col And &HFF0000) / &H10000
End Function

F-L
0
Rejoignez-nous