0 Members and 5 Guests are viewing this topic.
LoadFromMemory takes a pointer to a bitmap file in memory (the same thing that you would have on your hard drive).
This is what I was thinking. If that's the case, then the size of the resource will almost certainly not be equal to width*height*4
LoadFromMemory wants the bytes of a normal BMP file, not a Windows DIB.
QuoteLoadFromMemory wants the bytes of a normal BMP file, not a Windows DIB. I'm just wondering, isn't DIB the same thing that is inside bitmap files?
zeroimg.LoadFromMemory((const char*) lpvoid, SizeofResource(GetModuleHandle(NULL), hresource));
zeroimg.LoadFromPixels(128, 128, (const Uint8*) lpvoid);
The Pixel Array is a block of 32-bit DWORDs, that describes the image pixel by pixel. Normally pixels are stored "upside-down" with respect to normal image raster scan order, starting in the lower left corner, going from left to right, and then row by row from the bottom to the top of the image.[1]Uncompressed Windows bitmaps also can be stored from the top to bottom, when the Image Height value is negative.