CDC Methods

Construction Methods

Method Description
CDC Constructs a CDC object.

Initialization Methods

Method Description
Attach Attaches a Windows CE device context to this CDC object.
CreateCompatibleDC Creates a memory-device context that is compatible with another device context. You can use it to prepare images in memory.
DeleteDC Deletes the Windows CE device context associated with this CDC object.
DeleteTempMap Called by the CWinApp idle-time handler to delete any temporary CDC object created by FromHandle. Also detaches the device context.
Detach Detaches the Windows CE device context from this CDC object.
FromHandle Returns a pointer to a CDC object when specified a handle to a device context. If a CDC object is not attached to the handle, a temporary CDC object is created and attached.
GetCurrentBitmap Returns a pointer to the currently selected CBitmap object.
GetCurrentBrush Returns a pointer to the currently selected CBrush object.
GetCurrentFont Returns a pointer to the currently selected CFont object.
GetCurrentPen Returns a pointer to the currently selected CPen object.
ReleaseAttribDC Releases m_hAttribDC, the attribute device context.
ReleaseOutputDC Releases m_hDC, the output device context.
SetAttribDC Sets m_hAttribDC, the attribute device context.
SetOutputDC Sets m_hDC, the output device context.

Device Context Methods

Method Description
GetDeviceCaps Retrieves a specified kind of device-specific information about a specified display device’s capabilities.
GetSafeHdc Returns m_hDC, the output device context.
IsPrinting Determines whether the device context is being used for printing.
RestoreDC Restores the device context to a previous state saved with SaveDC.
SaveDC Saves the current state of the device context.

Drawing-Tool Methods

Method Description
GetBrushOrg Retrieves the origin of the current brush.
SetBrushOrg Specifies the origin for the next brush selected into a device context.

Type-Safe Selection Methods

Method Description
SelectObject Selects a GDI drawing object such as a pen.
SelectStockObject Selects one of the predefined stock pens, brushes, or fonts provided by Windows CE.

Color and Color Palette Methods

Method Description
GetHalftoneBrush Retrieves a halftone brush.
GetNearestColor Retrieves the closest logical color to a specified logical color that the specified device can represent.
RealizePalette Maps palette entries in the current logical palette to the system palette.
SelectPalette Selects the logical palette.

Drawing-Attribute Methods

Method Description
GetBkColor Retrieves the current background color.
SetBkColor Sets the current background color.
GetBkMode Retrieves the background mode.
SetBkMode Sets the background mode.
SetROP2 Sets the current drawing mode.
GetTextColor Retrieves the current text color.
SetTextColor Sets the text color.

Mapping Methods

Method Description
GetMapMode Retrieves the current mapping mode.
GetViewportOrg In Windows CE, this method does not do anything. It is included for compatibility with existing code.
GetViewportExt In Windows CE, this method does not do anything. It is included for compatibility with existing code.
GetWindowOrg In Windows CE, this method does not do anything. It is included for compatibility with existing code.
GetWindowExt In Windows CE, this method does not do anything. It is included for compatibility with existing code.

Coordinate Methods

Method Description
DPtoLP In Windows CE, this method does not do anything. It is included for compatibility with existing code.
LPtoDP In Windows CE, this method does not do anything. It is included for compatibility with existing code.

Clipping Methods

Method Description
ExcludeClipRect Creates a new clipping region that consists of the existing clipping region minus the specified rectangle.
ExcludeUpdateRgn Prevents drawing within invalid areas of a window by excluding an updated region in the window from a clipping region.
GetClipBox Retrieves the dimensions of the tightest bounding rectangle around the current clipping boundary.
IntersectClipRect Creates a new clipping region by forming the intersection of the current region and a rectangle.
OffsetClipRgn Moves the clipping region of the specified device.
RectVisible Determines whether any part of the specified rectangle lies within the clipping region.
SelectClipRgn Combines the specified region with the current clipping region by using the specified mode.

Line-Output Methods

Method Description
GetCurrentPosition Retrieves the current position of the pen (in logical coordinates).
MoveTo Moves the current position.
LineTo Draws a line from the current position up to, but not including, a point.
Polyline Draws a set of line segments connecting the specified points.
PolyPolyline Draws multiple series of connected line segments. The current position is neither used nor updated by this method .
PolylineTo Draws one or more straight lines and moves the current position to the ending point of the last line.

Simple Drawing Methods

Method Description
Draw3dRect Draws a three-dimensional rectangle.
DrawDragRect Erases and redraws a rectangle as it is dragged.
DrawEdge Draws the edges of a rectangle.
DrawIcon Draws an icon.
FillRect Fills a specified rectangle by using a specific brush.
FillSolidRect Fills a rectangle with a solid color.
FrameRect Draws a border around a rectangle.
InvertRect Inverts the contents of a rectangle.

Ellipse and Polygon Methods

Method Description
DrawFocusRect Draws a rectangle in the style used to indicate focus.
Ellipse Draws an ellipse.
Polygon Draws a polygon consisting of two or more points (vertices) connected by lines.
PolyPolygon Creates two or more polygons that are filled using the current polygon-filling mode. The polygons may be disjoint or they may overlap.
Polyline Draws a polygon consisting of a set of line segments connecting specified points.
Rectangle Draws a rectangle using the current pen and fills it using the current brush.
RoundRect Draws a rectangle with rounded corners using the current pen and filled using the current brush.

Bitmap Methods

Method Description
PatBlt Creates a bit pattern.
BitBlt Copies a bitmap from a specified device context.
StretchBlt Moves a bitmap from a source rectangle and device into a destination rectangle, stretching or compressing the bitmap if necessary to fit the dimensions of the destination rectangle.
GetPixel Retrieves the RGB color value of the pixel at the specified point.
SetPixel Sets the pixel at the specified point to the closest approximation of the specified color.
MaskBlt Combines the color data for the source and destination bitmaps using the specified mask and raster operation.

Text Methods

Method Description
ExtTextOut Writes a character string within a rectangular region using the currently selected font.
DrawText Draws formatted text in the specified rectangle.
GetTextExtent Computes the width and height of a line of text on the attribute device context using the current font to determine the dimensions.
GetOutputTextExtent Computes the width and height of a line of text on the output device context using the current font to determine the dimensions.
GetTextFace Copies the typeface name of the current font into a buffer as a null-terminated string.
GetTextMetrics Retrieves the metrics for the current font from the attribute device context.
GetOutputTextMetrics Retrieves the metrics for the current font from the output device context.

Advanced Drawing Methods

Method Description
DrawFrameControl Draws a frame control.

Printer/Device Escape Methods

Method Description
AbortDoc Terminates the current print job, erasing everything the application has written to the device since the last call of the StartDoc method.
EndDoc Ends a print job started by the StartDoc method.
EndPage Informs the device driver that a page is ending.
SetAbortProc Sets a programmer-supplied callback method that Windows CE calls if a print job must be aborted.
StartDoc Informs the device driver that a new print job is starting.
StartPage Informs the device driver that a new page is starting.

Scrolling Methods

Method Description
ScrollDC Scrolls a rectangle of bits horizontally and vertically.