Click to See Complete Forum and Search --> : Read Pixels in Bytes


dev
July 4th, 2001, 09:44 PM
I have a picture on a picture box.
I need to read or get every byte of the picture.
One pixel consists of 3 bytes(24 bits). I need to get byte by byte.
The GetPixel function only gets the pixel value which consists of 3 bytes or less.

Please help me.
Dev.

shree
July 5th, 2001, 08:00 AM
This is the simpler method: GetPixel and divide it into the separate R, G and B components


col = GetPixel(10,10)
red = col and &hff
green = (col and &hff00&)/&h100&
blue =(col and &hff0000)/&h10000




But it is relatively slower. A faster (and more complicated) method would be to use SAFEARRAY or use GetDIBits() API to get the bytes of the image.

dev
July 8th, 2001, 09:03 PM
How do I use the GetDIBits() function to get bytes of the pixels on an image.
I need to get every 64 bits of the image.
Please help

Dev.