Loading af DIB picture.

As a little spare time project, i am trying to make at DIB loader
for an OpenGL application of mine. But the problem is that the data being copied into my struct is totally correupted.
Is i just me doing something wrong ?? (properbly)

// partial code shown here.

struct DIBitmapHeader{
unsigned long biSize;
long biWidth;
long biHeight;
unsigned short biPlanes;
unsigned short biBitCount;
unsigned long biCompression;
unsigned long biSizeImage;
long biXPelsPerMeter;
long biYPelsPerMeter;
unsigned long biClrUsed;
unsigned long biClrImportant;

/* code */
fopen(path,"r" );
/* code */
fread(&DIB_HEADER, sizeof(DIB_HEADER),1,dib_file)

/* The output is NOT what i expected */

We all have to start some where.

Thanks in advance.

(Dont mind my poor english)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!