I am trying to show a jpeg image from a resource with GDI+.
I've made a JPEG resource called IDR_JPEG1 in VC++ 7.1 with the type "JPEG".
I've used this code:
It compiles but no image is shown.Code:// Graphics declaration above... LPSTREAM stream; HGLOBAL imageMem = LoadResource(GetModuleHandle(0), FindResource(GetModuleHandle(0), MAKEINTRESOURCE(IDR_JPEG1), "JPEG")); CreateStreamOnHGlobal(imageMem, false, &stream); Image image(stream); graphics.DrawImage(&image, 0, 0, 50, 50);
But when i do
the image is shown...Code:Image image(L"res/generals.jpg"); graphics.DrawImage(&image, 0, 0, 50, 50);
What is wrong ?



LinkBack URL
About LinkBacks


