The pen, brush, bitmap, palette, region, and path associated with a DC are referred to as its graphic objects. The following attributes are associated with each of these objects
与DC相联系的画笔,笔刷,调色板,区域和路径被称为图形对象,以下属性与每个对象相关联。
Graphic object | Associated attributes |
---|---|
Bitmap | Size, in bytes; dimensions, in pixels; color-format; compression scheme; and so on. |
Brush | Style, color, pattern, and origin. |
Palette | Colors and size (or number of colors). |
Font | Typeface name, width, height, weight, character set, and so on. |
Path | Shape. |
Pen | Style, width, and color. |
Region | Location and dimensions. |
When an application creates a DC, the system automatically stores a set of default objects in it. (There is no default bitmap or path.) An application can examine the attributes of the default objects by calling the GetCurrentObject and GetObject functions. The application can change these defaults by creating a new object and selecting it into the DC. An object is selected into a DC by calling the SelectObject function
当应用程序创建一个DC时,系统自动为它初始化一系列默认对象。(没有默认位图对象或路径对象。)程序可调用GetCurrentObject和GetObject函数检查这些对象的属性,也可以通过新建对象并且选择到DC中。对象通过调用SelectObject函数选择到DC中,以覆盖默认对象。
An application can set the current brush color to a specified color value with SetDCBrushColor .
应用程序可以用SetDCBrushColor函数将当前画笔的颜色设置为指定的颜色。
The GetDCBrushColor function returns the DC brush color. The SetDCPenColor function sets the pen color to a specified color value. The GetDCPenColor function returns the DC pen color.
GetDCBrushColor函数返回DC的画笔颜色。SetDCPenColor函数设置钢笔的颜色为指定指定颜色值,GetDCPenColor返回当前DC中钢笔的颜色值。