lundi 27 juin 2016

C++ have problems when loading bitmap images not created with paint [on hold]


If i create a bitmap in paint, C++ can read that file. But when i try Gimp the file dont work anymore, and the image is 4 times larger in paint.

And if i load that image in paint and re save the file as .bmp, it works.

With Magick++ converted the file made in paint from .bmp to .bmp and that file was 30 times smaler than the original made in paint.

And C++ can't load that image.

I have looked at the Properties for the images and they are the same... except the size.

And that brings me to why can't C++ load all bitmaps?

Added:

When i say C++ can't load the image i mean that C++ LoadImage Returns NULL and don't load the image.

Code Snippet:

HBITMAP BMP = (HBITMAP)LoadImageW(0,L"logo.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);

The code only works with the bitmap created in paint.

Edit 3:

The real properties

Messed up the files and did'nt se that only 2 images had the same properties except size

The file saved in paint had 32 bitdepth and was 1.17 MB

The file saved in gimp had 8 bitdepth and was 301 KB

And the file saved in Magick++ had 32 bitdepth and was 50.8 KB

EDIT 4 / The explanation of what help i want

I should not be editing this much

C++ loads all bitmaps that is created with paint, and only paint That i know.

Is there a library or function that support all pictures that can be easly rendered with HDI


Aucun commentaire:

Enregistrer un commentaire