I am trying to convert hBitmap to an array of bytes, but I do not want to use TBitmap from Unit Graphics. My input image is 128x64x32bit.
var TheBits: array of array of Cardinal; begin with info.bmiHeader do begin biWidth:=131; biHeight:=64; biSize:=SizeOf(TBITMAPINFOHEADER); biCompression:=BI_RGB; biBitCount:=32; biPlanes:=1; biSizeImage:=0; end; DC := CreateCompatibleDC(0); SetLength(TheBits, 128, 64); GetDIBits(DC, BmpHandle, 0, 64,@TheBits[0][0],Info,DIB_RGB_COLORS);
This gives me a nice image (of course, the leg), but I had to insert 131 into biWidth, which makes no sense to me. Why can't it be 128?
source share