Overview of the configuration method using GDI + in VC _c language

Source: Internet
Author: User

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 +:

using namespace Gdiplus;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.