#pragma comment(lib, "gdiplus.lib") #include <windows.h> #include <gdiplus.h>
using namespace Gdiplus;
GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken;
void initGdiPlus() { GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); }
void OnPaint(HDC hDC) { Graphics graphics(hdc); Image image(L"untitled.jpg"); // If you have the raw data of the image for some reason, // use the other snippet for making it an IStream // And use the Image constructor which recieves an IStream. graphics.DrawImage(&image, Point(0, 0)); }
void destroyGdiPlus() { GdiplusShutdown(gdiplusToken); } |