Original Post
I''m using C++. I want to load a bitmap into memory (always 24 bit, always 50x50 pixels). I then want to go through each of the pixels reading their RGB values. Basically, the bitmap is a heightmap for the land in my DX game. I will be using only the red component for this.
The code I am using to load the bitmap into memory is this:
// handle to bitmap HBITMAP hbm; // load bitmap hbm = (HBITMAP)LoadImage(NULL, "..\\maps/map001.bmp", IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION|LR_DEFAULTSIZE|LR_LOADFROMFILE);I think this is correct? Now how do I access a pixel and read its RGB value? I was thinking of using GetPixel (even though its slow), but it seems that you need a device context, and as this is just stored in memory I dont have one (or do I and Im being dumb?). Thanks in advance Kieran