- Add the following line to your stdafx.h
#include <gdiplus.h> using namespace Gdiplus; #pragma comment(lib, "gdiplus.lib")
- Intialize the GDI+ resources. Add this to your
CWinApp
derived class as member:GdiplusStartupInput gdiplusStartupInput; ULONG_PTR gdiplusToken;
At
InitInstance()
, add:GdiplusStartup(gdiplusToken, gdiplusStartupInput, NULL);
- Your application is ready to consume GDI+ now.
- Upon exit, release GDI+ resources. Add the following line to
ExitInstance()
:GdiplusShutdown(gdiplusToken);