[转]CvvImage类以及在MFC中显示IplImage图像的方法
2010-11-29 09:48
357 查看
转自:http://blog.sina.com.cn/s/blog_532f5c210100gxrw.html
在MFC的View类中:
1 void CMyView::ShowIplImage(IplImage* img)
2 {
3 CDC* pDC = GetDC();
4 HDC hDC= pDC->GetSafeHdc(); CRect rect; rect.SetRect(0 , 0 , img->width , img->height); CvvImage cimg; cimg.CopyOf(img); cimg.DrawToHDC(hDC,&rect); ReleaseDC(pDC);
5 }
在Dialog中:
1 void Cdialog_iplImageDlg::DrawPicToHDC(IplImage* iplimg , UINT ID)
2 {
3 CDC *pDC = GetDlgItem(ID)->GetDC();
4 HDC hDC= pDC->GetSafeHdc();
5 CRect rect;
6 GetDlgItem(ID)->GetClientRect(&rect);
7 CvvImage cimg;
8 cimg.CopyOf(iplimg);
9 cimg.DrawToHDC(hDC,&rect);
10 ReleaseDC(pDC);
11 }
在MFC的View类中:
1 void CMyView::ShowIplImage(IplImage* img)
2 {
3 CDC* pDC = GetDC();
4 HDC hDC= pDC->GetSafeHdc(); CRect rect; rect.SetRect(0 , 0 , img->width , img->height); CvvImage cimg; cimg.CopyOf(img); cimg.DrawToHDC(hDC,&rect); ReleaseDC(pDC);
5 }
在Dialog中:
1 void Cdialog_iplImageDlg::DrawPicToHDC(IplImage* iplimg , UINT ID)
2 {
3 CDC *pDC = GetDlgItem(ID)->GetDC();
4 HDC hDC= pDC->GetSafeHdc();
5 CRect rect;
6 GetDlgItem(ID)->GetClientRect(&rect);
7 CvvImage cimg;
8 cimg.CopyOf(iplimg);
9 cimg.DrawToHDC(hDC,&rect);
10 ReleaseDC(pDC);
11 }
相关文章推荐
- CvvImage类以及在MFC中显示IplImage图像的方法(转)
- CvvImage类以及在MFC中显示IplImage图像的方法
- CvvImage类以及在MFC中显示IplImage图像的方法
- CvvImage类以及在MFC中显示IplImage图像的方法
- 利用 OpenCV 在MFC中显示图像问题以及解决方法
- 【VC++】在MFC中显示IplImage图像的方法
- 不使用CvvImage类来在MFC中显示图像
- vc/mfc获取rgb图像数据后动态显示及保存图片的方法
- MFC+OpenCV 利用Show方法使图像不拉伸显示在Picture控件上
- MFC 两种创建状态栏方法以及在状态栏实时显示时间
- 利用MFC和opencv读取视频显示图像方法
- 在vc或mfc中显示IplImage的方法
- vc/mfc获取rgb图像数据后动态显示及保存图片的方法
- 关于MFC中显示OpenCV Mat矩阵中的图像(一种新的解决方法)
- MFC+Opencv显示图像的几种方法
- Opencv图像在MFC中显示的几种方法
- 在MFC中显示IplImage图像
- MFC获取rgb图像数据后动态显示及保存图片的方法
- MFC中CImage类显示的半透明PNG存在的问题以及处理方法
- vc/mfc获取rgb图像数据后动态显示及保存图片的方法