This article takes Visual C + + 6.0 and Visual Studio 2003 as an example to briefly describe how GDI is configured in VC, as follows:
First, for Visual C + + 6.0 Users:
1. Download the library of GDI +. Running GDI + requires a GdiPlus.dll file; The program for developing GDI + also requires GdiPlus.lib and gdiplus*.h files. These are all available on Microsoft's website. (A detailed search of the Windows SDK is all out)
2. Place the above documents in a directory in your project and then include #include "GdiPlus.h" in the stdafx.h (depending on where you put the files)
3. In the "project"-> "option", add a link library GdiPlus.lib (specific location to find it yourself)
Second, for Visual Studio 2003 users:
There is no need to download the GDI + library, because VS2003 already has it. As long as you include the #include <gdiplus.h> in the StdAfx.h file, and fill in the desired Lib library in the project-> option-> linker-> input. Gdiplus.lib can
In the program's app class, add a member variable: ULONG_PTR M_gdiplustoken;
In the app's InitInstance function, in this sentence:
INT_PTR Nresponse = dlg. DoModal ();
Before, add the following statement:
Gdiplus::gdiplusstartupinput Gdiplusstartupinput;
Gdiplus::gdiplusstartup (&m_gdiplustoken, &gdiplusstartupinput, NULL);
In this sentence:
INT_PTR Nresponse = dlg. DoModal ();
Then add the following statement:
Gdiplus::gdiplusshutdown (M_gdiplustoken);
You can use GDI +. When used, note that you first declare namespaces that use GDI +: