HHE
Nov 8th, 1999, 07:47 PM
When I read the color from an image with the point command it returns a long integer.
How can I get the RGB's from that?
Aaron Young
Nov 9th, 1999, 08:37 PM
Here's one method:
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim sColor As String
Dim iRed As Integer
Dim iGreen As Integer
Dim iBlue As Integer
sColor = Hex$(Picture1.Point(X, Y))
iBlue = Val("&H" & Left$(sColor, 2))
iGreen = Val("&H" & Mid$(sColor, 3, 2))
iRed = Val("&H" & Right$(sColor, 2))
Caption = "R: " & Right$("000" & iRed, 3) & _
" G: " & Right$("000" & iGreen, 3) & _
" B: " & Right$("000" & iBlue, 3)
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net