# Red, Green and Blue

If I open an image using picturebox/imagebox. Is there any way I can get the R, G, and B value of each single pixel?
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Yes, using the Point() method will give you the RGB value, the following code will give you the individual values:

Dim lRes  As Long
Dim sColor As String
Dim nRed  As Integer
Dim nGrn  As Integer
Dim nBlu  As Integer

lRes = Picture1.Point(1, 1)
sColor = Right\$("000000" & Hex\$(lRes), 6)
nRed = Val("&H" & Mid\$(sColor, 5, 2))
nGrn = Val("&H" & Mid\$(sColor, 3, 2))
nBlu = Val("&H" & Mid\$(sColor, 1, 2))
Debug.Print nRed, nGrn, nBlu

0

Experts Exchange Solution brought to you by