Compartir a través de


AfxGetDitheredBitmap

Copies a bitmap, replacing its background with a dithered (checker) pattern.

void AFXAPI AfxGetDitheredBitmap( 
   const CBitmap &rSrc, 
   CBitmap *pDest, 
   COLORREF cr1, 
   COLORREF cr2 
);

Parameters

  • rSrc
    The source bitmap.

  • pDest
    The destination bitmap.

  • cr1
    One of the two dither colors, typically white.

  • cr2
    The other dither color, typically light gray (COLOR_MENU).

Remarks

The source bitmap is copied to the destination bitmap with a two-color (cr1 and cr2) checkered pattern replacing the source bitmap's background. The background of the source bitmap is defined as its white pixels and all pixels matching the color of the pixel in the upper-left corner of the bitmap.

Comparison of dithered and original icon versions

Example

CBitmap bm;
bm.LoadBitmap(IDB_BITMAP1);
CBitmap bmDith;
AfxGetDitheredBitmap(bm, &bmDith, RGB(255,255,255),
   GetSysColor(COLOR_BTNFACE));

Requirements

Header: afxwin.h

See Also

Reference

AfxDrawDitheredBitmap

AfxGetGrayBitmap

Concepts

MFC Macros and Globals

Other Resources

Gray and Dithered Bitmap Functions