Export (0) Print
Expand All

Graphic Modes

Windows supports five graphic modes that allow an application to specify how colors are mixed, where output appears, how the output is scaled, and so on. These modes, which are stored in a DC, are described in the following table.

Graphics modeDescription
BackgroundDefines how background colors are mixed with existing window or screen colors for bitmap and text operations.
DrawingDefines how foreground colors are mixed with existing window or screen colors for pen, brush, bitmap, and text operations.
MappingDefines how graphics output is mapped from logical (or world) space onto the window, screen, or printer paper.
Polygon-fillDefines how the brush pattern is used to fill the interior of complex regions.
StretchingDefines how bitmap colors are mixed with existing window or screen colors when the bitmap is compressed (or scaled down).

 

As it does with graphic objects, the system initializes a DC with default graphic modes. An application can retrieve and examine these default modes by calling the following functions.

Graphics modeFunction
Background GetBkMode
Drawing GetROP2
Mapping GetMapMode
Polygon-fill GetPolyFillMode
Stretching GetStretchBltMode

 

An application can change the default modes by calling one of the following functions.

Graphics modeFunction
Background SetBkMode
Drawing SetROP2
Mapping SetMapMode
Polygon-fill SetPolyFillMode
Stretching SetStretchBltMode

 

 

 

Community Additions

ADD
Show:
© 2015 Microsoft