level 1
走的那么干脆1
楼主
求问大神,我写了一个显示图片的代码如下,但奇怪的是如果我多次调用这个函数来显示不同的图片,显示窗口只显示第一次调用此函数时的图片(一直保持这张图片不会变),应该如何解决呢(程序中的其余函数是Halcon中自带的函数)
void CxuegaoMFCDlg::DrawHoImage(HObject h_pImage)
{
//EnterCriticalSection(&h_csShow);
HTuple HWindowID;
CRect Rect;
HTuple m_HWindowID;
HTuple m_ImageWidth, m_ImageHeight;
CWnd* pWnd = GetDlgItem(IDC_STATIC);
HWindowID = (Hlong)pWnd->GetSafeHwnd();;//获取父窗口句柄
pWnd->GetClientRect(&Rect);
OpenWindow(0, 0, Rect.Width(), Rect.Height(), HWindowID, "visible", "", &m_HWindowID);
GetImagePointer1(h_pImage, NULL, NULL, &m_ImageWidth, &m_ImageHeight);
SetPart(m_HWindowID, 0, 0, m_ImageHeight - 1, m_ImageWidth - 1);
DispObj(h_pImage, m_HWindowID);
}
2017年08月06日 07点08分
1
void CxuegaoMFCDlg::DrawHoImage(HObject h_pImage)
{
//EnterCriticalSection(&h_csShow);
HTuple HWindowID;
CRect Rect;
HTuple m_HWindowID;
HTuple m_ImageWidth, m_ImageHeight;
CWnd* pWnd = GetDlgItem(IDC_STATIC);
HWindowID = (Hlong)pWnd->GetSafeHwnd();;//获取父窗口句柄
pWnd->GetClientRect(&Rect);
OpenWindow(0, 0, Rect.Width(), Rect.Height(), HWindowID, "visible", "", &m_HWindowID);
GetImagePointer1(h_pImage, NULL, NULL, &m_ImageWidth, &m_ImageHeight);
SetPart(m_HWindowID, 0, 0, m_ImageHeight - 1, m_ImageWidth - 1);
DispObj(h_pImage, m_HWindowID);
}