Original Post
Im going nuts on this, im writing a converter of some sorts(not telling
) anyways I can''t get it to read a bitmap properly or at all..grr..
my code:>
And the output i get is:>
4194304
Whata fuck!!!!
This is so annoying, what kind of width is 4194304??? I mean the image is only 64 pixels wide... And theres nothing wrong with the image as I can open it in other programs...
Can anyone help me?
In the next 80 years 6 billion people will die...
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef long LONG;
struct BITMAPFILEHEADER
{
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
};
struct BITMAPINFOHEADER
{
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
};
void LoadBitmap(const char* pfileName)
{
FILE* pfile;
BITMAPFILEHEADER bf;
BITMAPINFOHEADER bi;
int len = 0;
pfile = fopen(pfileName, "rb");
fread(&bf, sizeof(bf), 1, pfile);
fread(&bi, sizeof(bi), 1, pfile);
printf("%i", bi.biWidth);;
printf("\nWhata fuck!!!!!");
fclose(pfile);
}
int main(int, char**)
{
LoadBitmap("test.bmp");
return 0;
}