I'm currently studying windows programming and writing a small image searching program.
I want to get (R, G, B) data of (x, y)pixel when I have HBITMAP handle of the image.
So, I tried to write something like this
//already have HBITMAP.
struct RGBpixel
{
int x, y;
unsigned char R, G, B;
};
bool getRGB(HBITMAP h_image, RGBpixel* pixel, x, y)
{
...
// put x, y values to pixel.x, pixel.y
// put R, G, B values to pixel.R, pixel.G, pixel.B
...
return true;
}
How can I write this?
I'd seen about GetPixel function but it was too slow for my program :( Any other fater method?