Share via


CDC::DrawState

BOOL DrawState( CPoint pt**, CSize** size**, HBITMAP** hBitmap**, UINT** nFlags**, HBRUSH** hBrush = NULL );

BOOL DrawState( CPoint pt**, CSize** size**, CBitmap*** pBitmap**, UINT** nFlags**, CBrush*** pBrush = NULL );

BOOL DrawState( CPoint pt**, CSize** size**, HICON** hIcon**, UINT** nFlags**, HBRUSH** hBrush = NULL );

BOOL DrawState( CPoint pt**, CSize** size**, HICON** hIcon**, UINT** nFlags**, CBrush*** pBrush = NULL );

BOOL DrawState( CPoint pt**, CSize** size**, LPCTSTR** lpszText**, UINT** nFlags**, BOOL** bPrefixText = TRUE, int nTextLen = 0, HBRUSH hBrush = NULL );

BOOL DrawState( CPoint pt**, CSize** size**, LPCTSTR** lpszText**, UINT** nFlags**, BOOL** bPrefixText = TRUE, int nTextLen = 0, CBrush* pBrush = NULL );

BOOL DrawState( CPoint pt**, CSize** size**, DRAWSTATEPROC** lpDrawProc**, LPARAM** lData**, UINT** nFlags**, HBRUSH** hBrush = NULL );

BOOL DrawState( CPoint pt**, CSize** size**, DRAWSTATEPROC** lpDrawProc**, LPARAM** lData**, UINT** nFlags**, CBrush*** pBrush = NULL );

Return Value

Nonzero if successful; otherwise 0.

Parameters

pt

Specifies the location of the image.

size

Specifies the size of the image.

hBitmap

A handle to a bitmap.

nFlags

Flags that specify the image type and state. See the Remarks section for the possible nFlags types and states.

hBrush

A handle to a brush.

pBitmap

A pointer to a Cbitmap object.

pBrush

A pointer to a Cbrush object.

hIcon

A handle to an icon.

lpszText

A pointer to text.

bPrefixText

Text that may contain an accelerator mnemonic. The lData parameter specifies the address of the string, and the nTextLen parameter specifies the length. If nTextLen is 0, the string is assumed to be null-terminated.

nTextLen

Length of the text string pointed to by lpszText.  If nTextLen is 0, the string is assumed to be null-terminated.

lpDrawProc

A pointer to a callback function used to render an image. This parameter is required if the image type in nFlags is DST_COMPLEX. It is optional and can be NULL if the image type is DST_TEXT. For all other image types, this parameter is ignored. For more information about the callback function, see the function in the Win32 SDK Programmer’s Reference.

lData

Specifies information about the image. The meaning of this parameter depends on the image type.

Remarks

Call this member function to display an image and apply a visual effect to indicate a state, such as a disabled or default state.

The parameter nFlag type can be set to one of the following values:

  • DST_BITMAP   The image is a bitmap. The low-order word of the lData parameter is the bitmap handle.

  • DST_COMPLEX   The image is application defined. To render the image, DrawState calls the callback function specified by the lpDrawProc parameter.

  • DST_ICON   The image is an icon. The low-order word of lData is the icon handle.

  • DST_PREFIXTEXT   The image is text that may contain an accelerator mnemonic. DrawState interprets the ampersand (&) prefix character as a directive to underscore the character that follows. The lData parameter specifies the address of the string.

  • DST_TEXT   The image is text. The lData parameter specifies the address of the string.

The parameter nFlag state can be one of following values:

  • DSS_NORMAL   Draws the image without any modification.

  • DSS_UNION   Dithers the image.

  • DSS_DISABLED   Embosses the image.

  • DSS_DEFAULT   Makes the image bold.

  • DSS_MONO   Draws the image using the brush specified by the hBrush or pBrush parameter.

Note   For all nFlag states except DSS_NORMAL, the image is converted to monochrome before the visual effect is applied.

For more information about the Windows API DrawState, see in the Win32 SDK Programmer’s Reference.

CDC OverviewClass MembersHierarchy Chart

See Also   ,