Differences between GDI + and GDI and some new features

Source: Internet
Author: User

[GDI + and GDI ]--All are hardware-accelerated.

1. GDI + is the next version of GDI, Which is improved and easier to use.

One advantage of GDI is that you do not have to know any details about how data is rendered on the device. It is better implemented by GDI +,

That is to say, GDI is a middle-and low-layer API. You may also need to know the device, while GDI + is a high-level API, and you do not need to know the device.

2. GDI isStatefulWhile GDI + isStateless.

3. Use the device environment (DC) And handle (Handle), While GDI + is all managed by the graphics class.

4. You can use SelectObject to frequently switch between drawing objects in GDI + mode. The graphic objects in GDI + mode are independent.

5. there is a "Current Position" (global area) in GDI to improve the Drawing performance, while GDI + canceled it, to avoid unexpected errors caused by uncertain current position during plotting.

6. GDI always binds the paint brush and paint brush together, and you must specify a paint brush even if you do not need to fill a region; while GDI + can use different functions to separate the paint brush and painting brush.

[New Features of GDI +]

1. ImprovedColor Management. GDI + not only provides more available colors, but also supports alpha-channel synthesis, and maintains compatibility with other colors.

2. DrawingSupport for anti-aliasing. By setting the relevant attributes of the GDI + object, the GDI + can be used together with the relevant display driver to complete the anti-sawtooth function during drawing, making the drawing smoother and more beautiful, the entire process is automatically calculated by the GDI + object.

3. ProvideGradient Paint Brush. GDI + expands the functions of GDI, providing linear gradient and path gradient painting brush to fill the graphics, paths and areas, and even can be used to draw straight lines and curves.

4.Independent path object. GDI + uses graphics objects for drawing operations, and separates path operations from graphics objects to provide a graphics class for users to use. users do not have to worry that objects will be affected by graphics object operations, this allows you to use the same operation object to draw paths multiple times.

5.Spline. GDI + encapsulates the method for drawing the base spline curve and the besell spline curve.

6.Deformation and matrix operations. GDI + provides a powerful matrix class to implement Matrix Rotation, miscutting, translation, proportional conversion, and other transformation operations, so as to generate complex new graphics.

7.Multi-image format. This graphic processing capability allows you to access image files in multiple formats and convert file formats, it can also perform image processing, such as re-coloring, color correction, and elimination of image samples.

-----

[GDI + version]

1.. Net version

System. Drawing provides basic graphics functions, including drawing surface, images, colors, brushes, pens and fonts.

System. Drawing. drawing2d provides advanced grating and vector graphics Functions

System. Drawing. Imaging provides advanced image Functions

System. Drawing. Printing provides print and print preview functions.

System. Drawing. text provides the Advanced Font Function

System. drawing. the features provided by design can enhance the design support for custom controls, including the development of custom uitypeeditor classes, which can be used in Visual Studio.. net.

2.MFC version

Included in the gdiplus namespace.

GDI + class diagram structure: For details, seeMsdn

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.