Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load jpg file in winapi

Tags:

jpeg

winapi

I want to load a jpg file. I tried to use the LoadImage function but it returns NULL if my image is not bmp. What can I do? Here is my code:

hBitmap =(HBITMAP)LoadImage(0, L"D:\\1.jpg", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE).
like image 565
Samvel Siradeghyan Avatar asked Sep 05 '25 17:09

Samvel Siradeghyan


1 Answers

You can have a look at WIC.

Windows Imaging Component (WIC) API enables applications to work with all common image formats. It allows developers to not have to understand intricate details of the image formats they work with. WIC has built-in support for popular formats such as JPEG, PNG, TIFF, and GIF as well as an extensibility model so that developers can create their own WIC decoder and encoder (CODEC) and get platform level support for their image format. WIC is available on Windows XP (SP2 and greater), Windows Vista, Windows Server, and Windows 7.

like image 142
Gregory Pakosz Avatar answered Sep 09 '25 06:09

Gregory Pakosz