AfxDrawGrayBitmap

 

Draws a gray version of a bitmap.

Syntax

      void AFXAPI AfxDrawGrayBitmap(
   CDC *pDC,
   int x,
   int y,
   const CBitmap &rSrc,
   COLORREF crBackground
);

Parameters

  • pDC
    Points to the destination DC.

  • x
    The destination x-coordinate.

  • y
    The destination y-coordinate.

  • rSrc
    The source bitmap.

  • crBackground
    The new background color (typically gray, such as COLOR_MENU).

Remarks

A bitmap drawn with AfxDrawGrayBitmap will have the appearance of a disabled control.

Comparison of gray and original icon versions

Example

void CDCView::DrawGrayBitmap(CDC* pDC)
{
   CBitmap bm;
   bm.LoadBitmap(IDB_BITMAP1);
   AfxDrawGrayBitmap(pDC, 10, 50, bm, GetSysColor(COLOR_MENU));
}

Requirements

Header: afxwin.h

See Also

MFC Macros and Globals
Gray and Dithered Bitmap Functions
AfxGetGrayBitmap
AfxDrawDitheredBitmap