I'm trying to compare images, but the alpha is making the comparison fail (even if the rgb are correct)
Is what I'm using to get the bytes of the image.Code:BITMAP large; GetObject(hScreen, sizeof(BITMAP), &large); int lBps = large.bmBitsPixel / 8; int lSize = large.bmHeight * large.bmWidth * lBps; BYTE *lBytes = new BYTE[lSize]; GetBitmapBits(hScreen, lSize, lBytes);
I've been able to solve this by a cheap little hack:
However, I'm curious... what would be the best way to do this? I'm getting the HBITMAP via CreateCompatabileBitmap and BitBlt'ing the image to it with SRCCOPY.Code:for (int z = 3; z < lSize-4; z+=4) lBytes[z] = 0;
Again, my problem has been solved by the simple for loop, and everything works fine. I'm just curious if there's a better method.
Thanks for any input.




Reply With Quote