?
Mit IPicture kannst du laden jpg, gif, bmp...
#include <olectl.h>
HBITMAP LoadImg(WCHAR *path, int *lpWidth, int *lpHeight)
{
HBITMAP outbm = 0;
CoInitialize(NULL);
IPicture *pic;
if (!OleLoadPicturePath(path, 0, 0, 0, IID_IPicture, (void**)&pic))
{
OLE_XPOS_HIMETRIC ole_w, ole_h;
pic->get_Width(&ole_w);
pic->get_Height(&ole_h);
HDC deskdc = GetDC(NULL);
HDC outdc = CreateCompatibleDC(deskdc);
int w,h;
w = MulDiv(ole_w, GetDeviceCaps(outdc, LOGPIXELSX), 2540);
h = MulDiv(ole_h, GetDeviceCaps(outdc, LOGPIXELSY), 2540);
if (lpWidth) *lpWidth=w;
if (lpHeight) *lpHeight=h;
// alloc new bitmap and render the image
outbm = CreateCompatibleBitmap(deskdc, w,h);
HGDIOBJ oldbm = SelectObject(outdc,outbm);
pic->Render(outdc, 0,0,w,h,0, ole_h, ole_w, -ole_h, NULL);
SelectObject(outdc,oldbm);
ReleaseDC(NULL, deskdc);
DeleteDC(outdc);
pic->Release();
}
CoUninitialize();
return outbm;
}