I am trying to convert hBitmap to array of bytes but I don't 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 (upside down, of course) but I had to put 131 into biWidth which doesn't really make sense to me. Why can't it be 128?