文章目录
GDI绘图
GDI是Graphics Device Interface的缩写,称为图形设备接口,主要用来绘图,由动态链接库GDI32.DLL提供支持。
GDI就是一个函数库,提供了很多绘图函数(也就是GDI32.DLL中的导出函数)。GDI非常重要,不但应用程序使用它来绘图,Windows本身也使用GDI来显示用户界面,比如菜单、图标和鼠标指针等。
由mingw编译的WIN32 GDI绘图程序在链接时需要加参数-lgdi32
DC
Device Contexts
A device context is a structure that defines a set of graphic objects and their associated attributes, as well as the graphic modes that affect output. The graphic objects include a pen for line drawing, a brush for painting and filling, a bitmap for copying or scrolling parts of the screen, a palette for defining the set of available colors, a region for clipping and other operations, and a path for painting and drawing operations. The remainder of this section is divided into the following three areas.
设备上下文允许在 Windows 中进行与设备无关的绘制。设备上下文可用于绘制到屏幕、打印机或者图元文件。
Windows应用程