Upload jpg file to winapi

I want to download a jpg file. I tried to use the function LoadImage, but returns NULLif 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).
+3
source share
3 answers

You can take a look at WIC.

API- Windows Imaging Component (WIC) . , . WIC , JPEG, PNG, TIFF GIF, , WIC- (CODEC) . WIC Windows XP (SP2 ), Windows Vista, Windows Server Windows 7.

+3

GDI +, JPEG. #include <gdiplus.h> , , Image GdiplusStartup.

+3

If you want to support really old things (Win9x etc.), IPicture / OleLoadPicture is your best bet

+1
source

Source: https://habr.com/ru/post/1726603/


All Articles