Getting Pixels From Bitmaps
I have been debugging a program that involves the use of
the GetPixel function to get the colors of the pixels from
a user defined box on a bitmap that is loaded by the
program. The verson of the GetPixel function I have been
using has the handle as an external element ie.
GetWindowDC()->GetPixel(x - GetScrollPosition().x,y -
I have ensured that the x,y coordinates that are input to
the function agree with the raster grid of the Bitmap (ie
if I want pixel (300,300) on the bitmap, then x=300,
The problem that I have experienced is that when GetPixel
does not keep returning -1, the colors that are return do
not make sense when compared to the image on screen (ie.
black is returned when I know the pixel should be white).
Can someone please give me some advice. The subsequent
calculations that are preformed are of course greatly
affected by this problem which has stumped me for some