News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

bitmapinfoheader

Started by shankle, December 01, 2018, 08:50:45 AM

Previous topic - Next topic

shankle

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"

Vortex

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, you can find an example.

shankle

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?

Vortex

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


jj2007

Many structures are identical for 32- and 64-bit code. The exceptions concern mostly pointers and handles.

aw27

This means that the same bmp file works without change in either 32 or 64 bit. Thanks God.