PDA

Click to See Complete Forum and Search --> : converting a long to a RGB


deoblo1
Dec 5th, 2000, 09:32 PM
i am useing this

Public Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long

i am guessing it returns the color, but it is a long, how can i convert it to rbg?

HarryW
Dec 5th, 2000, 09:42 PM
This should do it:


Red = LngColour Mod 256
Green = Int(LngColour / 256) Mod 256
Blue = Int(LngColour / &h10000)