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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With