伪彩色显示的问题
超凡三眼仔 2007-04-26 10:09:32 我在做一款相机的实时显示时,需要做伪彩显示,显示图象部分如下:
请问我怎样可以做伪彩色显示呢?谢谢各位
CRect rect;
GetClientRect(&rect);
dc.DPtoLP(&rect);
// Make sure to draw only those parts of the image which are visible in the viewport
CSize Size;
m_ptrBitmap->GetSize(&Size);
rect.IntersectRect(rect, CRect(0, 0, Size.cx, Size.cy));
rect.InflateRect(1,1);
// Draw the image
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap* pBmpOld = dcMem.SelectObject (CBitmap::FromHandle((HBITMAP)m_ptrBitmap->GetBitmapHandle()));
{
dc.SetStretchBltMode(COLORONCOLOR);
}
dc.BitBlt(rect.left, rect.top, rect.Width(), rect.Height(), &dcMem, rect.left, rect.top, SRCCOPY);
dcMem.SelectObject(pBmpOld);