Hola, mi pregunta es la siguiente:
es posible pasar el header de un archivo bmp a un struct haciendo algo asi:
struct BITMAPFILEHEADER{
unsigned char bfType[2];
long int bfSize;
int bfReserved1;
int bfReserved2;
long int bfOffbits;
};
struct BITMAPINFOHEADER{
long int biSize;
long int biWidth;
long int biHeight;
int biPlanes;
int biBitCount;
long int biCompression;
long int biSizeImage;
long int biXPelsPerMeter;
long int biYPelsPerMeter;
long int biClrUsed;
long int biClrImportant;
};
struct BITMAPFILEHEADER EncabImag;
struct BITMAPINFOHEADER InfEncabImag;
fichero = fopen(argv[1],"rb");
fread(&EncabImag,sizeof(EncabImag),1, fichero);
fread(&InfEncabImag,sizeof(InfEncabImag),1, fichero);
Algo estoy haciendo mal porque la altura y anchura me dan un disparate...
Muchas gracias por anticipado ;D
¡Buenas!
Aqui (http://www.4shared.com/file/2OoPhQTE/BMP.html) tienes un conjunto de estructuras y funciones que hice hace un tiempo para manipular BMPs. Entre ellas las cabeceras.
Si tienes alguna duda o no entiendes algo, preguntame por pm.
¡Saludos!
Muchísimas gracias por tu respuesta.
Me ha sido realmente útil ;D