Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

Applications send output to a specified device by creating a device context (DC) for the device. The device context is a structure containing information about the device. Use a DC to store, retrieve, and modify the attributes of graphic objects and to specify graphic modes.

A DC also contains the attributes that determine how DirectDraw interacts with a device. These attributes eliminate the need to specify every piece of information Windows Embedded CE requires to display an object on a device. If you want to change an attribute, you can use attribute functions to change current device settings.

To create a DC, call a device context function, which then returns a device context handle that identifies the device.

To create a memory DC, call the CreateCompatibleDCfunction.

To create a DirectDraw surface DC, call the IDirectDrawSurface::GetDCfunction.

After you have the DC, you can manipulate it with the SelectObjectfunction and examine its current settings with the GetObjectand GetCurrentObjectfunctions.

The following table shows the DCs supported by Windows Embedded CE.

Device context Description

Memory

Supports text and bitmap drawing operations. The DC is obtained by calling the CreateCompatibleDCfunction.

DirectDraw surface

Supports text and bitmap operations on DirectDraw surfaces. The DC is obtained by calling the IDirectDrawSurface::GetDCmethod.

The following table shows the modes that control text display, such as how colors are mixed on the screen.

Graphics mode Description

Background

Defines how background colors are mixed with screen colors.

Foreground and background colors

Defines how foreground and background colors are used for text output.

Note:
Windows Embedded CE maps logical coordinates to physical coordinates in a 1:1 ratio from left to right and top to bottom.

See Also