绘制位图,替换其背景用一个仿 (检查器) 模式。
void AFXAPI AfxDrawDitheredBitmap(
CDC *pDC,
int x,
int y,
const CBitmap &rSrc,
COLORREF cr1,
COLORREF cr2
);
参数
pDC
指向目标 dc:date。x
目标 x 坐标。y
目标 y 坐标。rSrc
源位图。cr1
两抖动颜色之一,通常为空。cr2
另一抖动颜色,通常是浅灰色 (COLOR_MENU)。
备注
源位图与替换位图的背景的两种颜色 (cr1 和 cr2) 网格模式的目标 DC 绘制。源位图的背景定义为其与像素的颜色空白像素和所有像素的位图的左上角。
示例
void CDCView::DrawDitheredBitmap(CDC* pDC)
{
CBitmap bm;
bm.LoadBitmap(IDB_BITMAP1);
AfxDrawDitheredBitmap(pDC, 10, 50, bm, RGB(255,255,255),
GetSysColor(COLOR_BTNFACE));
}
要求
Header: afxwin.h