注册 登录
编程论坛 VC.NET论坛

实时图像显示问题

kongxiangfei 发布于 2011-04-25 10:50, 1976 次点击
  我用1394接口的摄像头采集了一帧图像,在VS2008VC++环境中,显示到对话框picturecontrol控件中使用了如下代码:
CDC*pDC;
CRect rect;  
CWnd *pWnd =GetDlgItem(IDC_STATIC);
        pWnd->GetClientRect(&rect);
         pDC=GetDC();
        SetStretchBltMode(pDC->GetSafeHdc(),
         HALFTONE);
       StretchDIBits(pDC->GetSafeHdc(),
                   0,
                     0,
            rect.right,
            rect.bottom,
            0,
            0,
          imageConverted .iCols,
         imageConverted .iRows,
          imageConverted .pData,
           &m_bitmapInfo,
           DIB_RGB_COLORS,
          SRCCOPY);
但是在VC#的环境中怎么实现呢?在vC#好像可以直接调用 StretchDIBits,但是怎么获取设备上下文呢(DC)?请求各位达人帮忙,谢谢!
0 回复
1