关于 CImage::StretchBlt的疑问,先谢过了!
最近做个CCD图像实时显示到对话框控件上的小程序
用到 CImage::StretchBlt显示
CImage m_Image[2]; // display image
CPaintDC dc(&m_PicView);
CRect PaintRect;
m_PicView.GetClientRect(&PaintRect);
dc.SetStretchBltMode(HALFTONE);
/* acquire lock for the time we access the image object */
WaitForSingleObject(m_ImageSwitchMutex,INFINITE);
/* paint image object when initialized */
if( !m_Image[m_nDisplayImageIndex].IsNull() )
{
m_Image[m_nDisplayImageIndex].StretchBlt(dc.m_hDC,PaintRect);
}
/* release lock */
ReleaseMutex(m_ImageSwitchMutex);
……
这里用到的StretchBlt原型是
BOOL StretchBlt( HDC hDestDC, const RECT& rectDest, DWORD dwROP = SRCCOPY ) const throw();
还有个重载函数
BOOL StretchBlt( HDC hDestDC, const RECT& rectDest, const RECT& rectSrc,DWORD dwROP = SRCCOPY ) const throw();
这里的rectSrc说的是A reference to a RECT structure, identifying the source.
那这个rectSrc是不是指的是我这个源图像所占的矩形呢,如果这样的话,也就意味着可以很方便的选取CCD图像的任一部分显示到指定的对话框控件上了,到底能不能呢?困惑中……