![]() Image->pixels = malloc(image->metadata.width * sizeof(ImageColors)) Image->pixels = malloc( image->metadata.height * sizeof(ImageColors *) ) This is how I read the pixels void readImage(char *filename, Image *image)įread(&(image->type), sizeof(ImageType), 1, imageFile) įread(&(image->header), sizeof(ImageHeader), 1, imageFile) įread(&(image->metadata), sizeof(ImageMetadata), 1, imageFile) The rows are correct only the column is some how duplicated and compressed. The header Data are ok but the image is not correct. But my problem is that after I wrote the image it is not correctly displayed. At the moment it is only for a 24 bpp Image later on I want to change it. I compared the hex values and they are the same until the header is finished. Hy I wanted to read a bmp file into a struct and write it then back but the image is alway black the header is ok. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |