[
Edit this section]
Graphics Device Interface: Graphical Device Interface
GDI is the abbreviation of graphics device interface. It refers to the graphic device interface. Its main task is to take charge of the system and drawing.ProgramInformation exchange between them to process the graphic output of all Windows programs.
In Windows, most applications with graphical interfaces are inseparable from GDI. With the many functions provided by GDI, We can conveniently output graphics on screens, printers, and other output devices, text and other operations. With the advent of GDI, programmers can convert the output of applications into outputs on hardware devices without having to care about hardware devices and device drivers, thus realizing the isolation between program developers and hardware devices, this greatly facilitates development.
How is GDI output?
To output graphics or text on the screen or other output devices, we must first obtain the handle of an object called the device description table (DC: device context), taking it as a parameter, call a variety of GDI functions to achieve the output of various text or graphics. The device description table is a data structure in which GDI stores data. The property content in this structure is related to a specific output device (display, printer, and so on, the attribute defines the working details of the GDI function. Here, the attribute determines the color of the text, the way in which the X and Y coordinates are mapped to the display area of the window, and so on.
Once the device description table handle is obtained, the system uses the default property value to fill the device description table structure.
If necessary, we can use some GDI functions to obtain and change the property values in the device description table.