[問題] MFC對話框
將一個視訊畫面
移到MFC對話框中
之後 我的對話框的介面就無法移動
不知道是哪裡出了問題
這是我的CODE
void CTest1Dlg::OnStart()
{
// TODO: Add your control notification handler code here
CvCapture* capture = NULL;
capture = cvCreateCameraCapture(0);//webcam
IplImage* frame = NULL; //cvCreateImage();
for(;;)
{
frame = cvQueryFrame(capture);
if(!frame)
break;
DrawPicToHDC(frame, IDC_STATIC_PIC);
int c = cvWaitKey(10);
if(c == 27)
break;
}
cvReleaseCapture(&capture);
}
void CTest1Dlg::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);
}
完整的程式:
http://www.badongo.com/cn/file/18192829#
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.127.182.4
推
11/03 22:06, , 1F
11/03 22:06, 1F
→
11/03 23:19, , 2F
11/03 23:19, 2F
推
11/04 00:21, , 3F
11/04 00:21, 3F
→
11/04 15:01, , 4F
11/04 15:01, 4F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章