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 ::DrawStateProc 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:

The parameter nFlag state can be one of following values:

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 ::DrawState in the Win32 SDK Programmer’s Reference.

CDC OverviewClass MembersHierarchy Chart

See Also   ::DrawState, ::DrawStateProc