【VC++】在MFC中显示IplImage图像的方法

来源:互联网 发布:淘宝买的东西靠谱不 编辑:程序博客网 时间:2024/05/18 18:15
在MFC显示IplImage图像的函数代码
void CTestDlg::DrawPicToHDC(IplImage* img, UINT ID){CDC *pDC = GetDlgItem(ID)->GetDC();HDC hDC= pDC->GetSafeHdc();CRect rect;GetDlgItem(ID)->GetClientRect(&rect);CvvImage cimg;  cimg.CopyOf(img);cimg.DrawToHDC(hDC,&rect);ReleaseDC(pDC);}