Windows GDI + is a subsystem of Windows XP or the Windows Server 2003 operating system that is responsible for displaying screen information and printing operations. GDI + is a set of APIs that are packaged in C + + classes.
GDI + can be divided into three parts:
<1> 2-d vector Graphics (2D vectors), this part mainly involves drawing some basic graphics, such as lines, curves, charts, etc. Basic graphics are made up of a series of dots in screen coordinates.
<2> Imaging (picture), some pictures are difficult to use vector drawing, so some of GDI + 's classes are used to draw these pictures, which store the picture as a bitmap
<3> fonts, fonts are mainly focused on displaying a variety of different sizes and styles of fonts.
The structure of GDI + class-based interfaces
Windows GDI + is based on the C + + class interface, including approximately 40 classes, 50 enumerations, and 6 structs. There are also some functions that do not belong to any class.
When using any GDI + function, you must specify a namespace: Gdiplus;
using namespace Gdiplus;
A function that does not belong to any class, where two are:
Status Gdiplusstartup (__out ulong_ptr token *token, __in const gdiplugsstartupinput *input, __out gdiplusstartupoutput *o utput); void Gdiplusshutdown (__in ulong_ptr token);
The Gdiplusstartup () function must be called before any GDI + functions are called, and the Gdiplusshutdown () function must be called after the GDI + is exhausted.
New features for GDI +:
The difference between GDI + and GDI is shown in two ways.
One, GDI + extends GDI by providing new functionality, such as gradient brushes (gradient brush) and alpha blending (alpha blending, transparency) and other new features.
Second, GDI + makes the graphical programming model easier and more flexible.
New features list:
1. Gradient Brushes (gradient brush), GDI + provides linear gradients and path gradient brushes to fill closed shapes, paths, and areas.
2. Cardinal splines, is composed of some columns of separate curves combined into a large curve.
3. Independent path Objects , in GDI, a path belongs to a device environment, and when the path is drawn, the path is destroyed. In GDI +, you can create and maintain multiple GraphicsPath objects that are detached from the graphics object. And when a graphicspath is drawn, it is not destroyed, so you can use the same GraphicsPath object multiple times.
4. transformationsand the Matrix object, conversion and matrices objects. GDI + provides a matrix object, which is a powerful tool for transformations (rotations, transformations, etc.).
5. scalable Regions , GDI + has greatly expanded the region supported by GDI. In GDI, region is stored in device coordinates, and the only transformation that can be used is translation. GDI + stores region in the world coordinate system and allows region to do any transformation that can be stored in the matrix. such as scaling, rotation and translate.
5. Alpha Blending , Alpha Blending allows you to specify the transparency of the color to fill. A transparent color is mixed with the background color, the higher the transparency, the more prominent the background color.
6. Support for multiple image Formats, supports multiple image formats. GDI + provides an image, Bitmap, Metafile class that allows you to load, save and manipulate images in a variety of formats, supported in tablet format:
BMP, GIF, JPEG, Exif, PNG, TIFF, ICON, WMF, EMF.
The difference between GDI + and GDI programming models
GDI + Overview