halcon 嵌入到MFC图像控件上

来源:互联网 发布:linux 文本编辑器 编辑:程序博客网 时间:2024/06/06 21:11

  picture control                                                            IDC_BMPWINDOW

设置显示句柄

 CRect rtWindow; HWND hImgWnd = GetDlgItem( IDC_BMPWINDOW)->m_hWnd; GetDlgItem( IDC_BMPWINDOW)->GetClientRect(&rtWindow); OpenWindow(rtWindow.left, rtWindow.top, rtWindow.Width(), rtWindow.Height(), (Hlong)hImgWnd, "visible", "", &m_htWindow); SetPart(m_htWindow, 0, 0, IMG_HEIGHT-1, IMG_WIDTH-1);//其中 IMG_HEIGHT 、IMG_WIDTH分别为512,,400.这个可以自行定义。

显示

 CString str; str=m_editOpenDir; char* ch=(char*)LPCTSTR(str); ReadImage(&m_hoImage, ch); DispObj(m_hoImage, m_htWindow); 



0 0