다음을 통해 공유


CDC::DrawState

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

Note

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

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  
);

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 DrawState in the Windows SDK 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 Windows SDK.

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

Return Value

Nonzero if successful; otherwise 0.

Requirements

Header: afxwin.h

See Also

Reference

CDC Class

Hierarchy Chart

DrawState

DrawStateProc