void CIMG_PJDlg::DrawMatToHDC( UINT ID, Mat img, int channel )
{
CDC *pDC = GetDlgItem(ID)->GetDC();
HDC hDC = pDC->GetSafeHdc();
CRect rect;
GetDlgItem(ID)->GetClientRect(&rect);
CvvImage cimg;
cimg.CopyOf(img,channel);
cimg.DrawToHDC( hDC, &rect );
ReleaseDC( pDC );
}
首先就是保证Mat类图片信息的完整性。。。不然出来的图像就这样的。。