Could someone translate the "C" version of a 64-bit BitMapInfoHeader into masm
please. I have looked but can find nothing but a "C" version.
I don't do "C"
Hi shankle,
BITMAPINFOHEADER STRUCT
biSize DWORD ?
biWidth DWORD ?
biHeight DWORD ?
biPlanes WORD ?
biBitCount WORD ?
biCompression DWORD ?
biSizeImage DWORD ?
biXPelsPerMeter DWORD ?
biYPelsPerMeter DWORD ?
biClrUsed DWORD ?
biClrImportant DWORD ?
BITMAPINFOHEADER ENDS
Here (http://masm32.com/board/index.php?topic=7185.0), you can find an example.
Thank you Vortex for replying.
So biwidth, biheight, bixpelspermeter & biypelspermeter are not 64-bits long.
I thought they were. And I guess DD will work in a 64-bit system?
Hello shankle,
You are right. Looking at the original C declaration of the structure :
typedef struct tagBITMAPINFOHEADER {
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
Building the code below as 64-bit :
#include <stdio.h>
#include <windows.h>
int main()
{
BITMAPINFOHEADER *bi;
printf("sizeof(BITMAPINFOHEADER->biWidth)=%u\n",sizeof(bi->biWidth));
return 0;
}
sizeof(BITMAPINFOHEADER->biWidth)=4
Many structures are identical for 32- and 64-bit code. The exceptions concern mostly pointers and handles.
This means that the same bmp file works without change in either 32 or 64 bit. Thanks God.