[Gambas-user] PictureBox.Picture.Image[x, y] output interpretation
Benoît Minisini
gambas at ...1...
Sun Jan 17 22:05:19 CET 2010
> 2010/1/17 kevinfishburne <kevinfishburne at ...1887...>:
> > When retrieving the value of a pixel at x,y from the picture in a
> > picturebox control it outputs a single value. How does this value
> > represent the pixel's value, and can it be easily converted to an RGB
> > value?
>
> Red = Value Mod 256
> Green = Int(Value / 256) Mod 256
> Blue = Int(Value / 256 / 256) Mod 256
>
Or you can use the [] operator on the Color class.
Color[MyColor].Red
Color[MyColor].Green
Color[MyColor].Blue
...
See the Color class documentation for all properties you can use on
Color[...].
Regards,
--
Benoît Minisini
More information about the User
mailing list