GDIPlus use
stdafx.h add the following code:
#include <comdef.h> // initialize it com port #include " GdiPlus.h " a using namespace Gdiplus; #pragma the Comment (lib, "gdiplus.lib")
Starts to initialize:
(.h) added in a statement app's category:
ULONG_PTR m_gdiplusToken;
InitInstance () where, in DoModal () function earlier, adding: // If there is no usingnamespace Gdiplus; we should add Gdiplus in front ::
GdiplusStartupInput gdiplusStartupInput; GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);
Overload ExitInstance, added GdiplusShutdown (m_gdiplusToken);
int CxxxApp :: the ExitInstance () { // the TODO: add this special code and / or calls the base class GdiplusShutdown (m_gdiplusToken); return the CWinApp :: the ExitInstance (); }
Use GDIPlus preparatory work done!
Reference links: