Device Contexts

A device context (DC) is a GDI structure containing information that governs the display of text and graphics on a particular output device. You use a DC to store, retrieve, and modify the attributes of graphic objects and to specify graphic modes. The graphic objects stored in a DC include a pen for line drawing, a brush for painting and filling, a font for text output, a bitmap for copying or scrolling, a palette for defining the available colors, and a region for clipping.

DCs supported by Windows CE are described in the following table.

Device context type Description
Display Supports drawing operations on display devices.
Printer Supports drawing operations on printers.
Memory Supports drawing operations on device-dependent bitmaps or DIB sections.

The graphics modes control general display characteristics, such as how colors are mixed. Graphics modes supported by Windows CE are described in the following table.

Graphics mode type Description
Background Mode Defines how background colors are mixed with window or screen colors for text and bitmap operations.
Drawing Mode Defines how foreground colors are mixed with window or screen colors for pen, brush, bitmap, and text operations.

Note Windows CE does not support multiple mapping modes. The only mapping mode is MM_TEXT, which maps logical coordinates to the physical coordinates in a 1:1 ratio from left to right and top to bottom.