The method and initialization of using GDI + in vc6.0

Source: Internet
Author: User

GDI + is a sub-system in Windows XP. It is mainly responsible for outputting information on the display screen and the printing device. It is a set of application programming interfaces implemented through C ++ class. As the name suggests, GDI + is the successor of the previous version of GDI. For compatibility considerations, Windows XP still supports the previous version of GDI, but when developing new applications, developers should use GDI + to meet the graphics output needs, because GDI + has optimized the GDI in previous Windows versions and added many new features.

Unfortunately, vc6.0 does not allow you to use GDI + directly. The following describes a convenient method for using GDI + in vc6.0. The procedure is as follows:

1.copy the files in the uplodes and Lib files to the uplodes and Lib folders in the VC directory;

GDI + for vc6.0 SDK:

Http://www.codeguru.com/code/legacy/gdi/GDIPlus.zip

2. Complete the initialization in the project where you are going to use GDI +:

Add the following code to the stdafx. h header file:

// Added header file
# Include <comdef. h> // initialize the comport.

# Ifndef ulong_ptr
# Define ulong_ptr unsigned long *
# Include "gdiplus. H"
Using namespace gdiplus;
# Endif
// End

3. Add the xxxdlg. h header file to the public file.

Ulong_ptr m_pgditoken;

 

4. Add in program Initialization

// Two variables used by GDI +
Gdiplusstartupinput m_gdiplusstartupinput;
// M_pgditoken;
// Load GDI +
Gdiplusstartup (& m_pgditoken, & m_gdiplusstartupinput, null );

5. Add it before exiting the program

// Uninstall GDI +
Gdiplusshutdown (m_pgditoken );

6. Add gdiplus. lib to project> stting> link> Object/libary.

In this way, you can use GDI + for your project. There is no technical content!

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.