新建mfc窗体
选择基于对话框
打开项目属性
// TODO: 在此添加控件通知处理程序代码
HObject ho_Image;
HTuple m_hWindowHandle;
HTuple hv_Width, hv_Height;
ReadImage(&ho_Image, "1.png");
GetImageSize(ho_Image, &hv_Width, &hv_Height);
GetDlgItem(IDC_STATIC)->MoveWindow(0, 0, hv_Width, hv_Height);
HWND hWnd = GetDlgItem(IDC_STATIC)->m_hWnd;
OpenWindow(0, 0, hv_Width, hv_Height, (LONG)hWnd, "visible", "", &m_hWindowHandle);
HDevWindowStack::Push(m_hWindowHandle);
if (HDevWindowStack::IsOpen)
{
DispObj(ho_Image, HDevWindowStack::GetActive());
}