I have a color returned from GetPixel, how to i extract the Red, Green, and Blue. Again, i have seen this before, but because search is disabled, i must post again.
Printable View
I have a color returned from GetPixel, how to i extract the Red, Green, and Blue. Again, i have seen this before, but because search is disabled, i must post again.
Here it goes!
Code:
put this in a module:
Public Type MyRGBColor
Red As Byte
Green As Byte
Blue As Byte
End Type
Public Type MyColor
RGB As Long
End Type
Form General declarations!
Dim mycol As MyColor
Dim RGBCol As MyRGBColor
Dim d As Long
Then in a sub:
d = GetPixel ...blah , blah
mycol.RGB = d
LSet RGBCol = mycol
Dim d1
d1 = (RGBCol.Red & "," & RGBCol.Green & "," & RGBCol.Blue)
MsgBox d1
Cheers
that's an interesting way to do it, i was originally looking for the arithmatic way, but this will do just fine, thanks alot!
i am getting unpredicable results with this method. does anyone have the arithmatic method. not to put you down, iScanning, but i'm only getting correct results rarely. i'm getting some inverted results and also some completly inaccurate results.
oops, my fault, it was a bug in my software, anyway, thanks, your method works fine!