VB Code:
Public Enum eRGBcolor
rgbRed = 1
rgbGreen
rgbBlue
End Enum
Private Function GetColorValue(nColor As Long, nReturnColor As eRGBcolor) As Integer
Select Case nReturnColor
Case rgbRed
GetColorValue = (nColor And &HFF&)
Case rgbGreen
GetColorValue = (nColor And &HFF00&) / &H100
Case rgbBlue
GetColorValue = (nColor And &HFF0000) / &H10000
Case Else
Err.Raise vbObjectError + 512, "GetColorValue", "Incorrect color for return value"
End Select
End Function
Now to get, for example, the value of red at the position 1, 1 in a picturebox named Picture1 you'll use code simular to this: