The GDI drawing consists of the following sections:
1. Drawing of points and lines
2. Draw the Fill area
Point
SetPixel () and GetPixel () are set pixel points and get pixel points.
In theory, all graphics device drivers only need to implement the SetPixel () function and the GetPixel () function, and everything else can be handled using higher-level programs in the GDI module. For example, to draw a line, GDI can constantly adjust the x and Y coordinates, and then call the SetPixel function continuously to draw all the required graphics. However, this can cause serious performance problems. So if a graphics system (such as GDI, or OpenGL, etc.) is built on top of the device driver hierarchy, then the performance of the device driver is much higher if it is done by drawing lines and other complex graphics.
The SetPixel () function sets the color of a point in a coordinate:
SetPixel (Hdc,x,y,crcolor); //
The GetPixel () function returns the color of a specified point pixel
Crcolor = GetPixel (hdc, x, y);
GDI, drawing