void ShowMatImgToWnd(CWnd* pWnd, cv::Mat img)
{
if(img.empty())
return;
CRect drect;
pWnd->GetClientRect(&drect); //(drect); (&drect); 两种方式均可,竟然
CClientDC dc(pWnd);
HDC hDC =dc.GetSafeHdc();
//内存中的图像数据拷贝到屏幕上
BYTE *bitBuffer = NULL;
BITMAPINFO *bitMapinfo = NULL;
int ichannels =img.channels();
if( ichannels == 1)
{
bitBuffer = new BYTE[40+4*256];
}
else if( ichannels == 3)
{
bitBuffer = new BYTE[sizeof(BITMAPINFO)];
}
else
{
return;
}
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载
- 1
- 2
- 3
前往页