2 xdmfc XDMFC 于 2014.08.07 18:52 提问

vc6.0mfc加载jpeg图片,但图片上有控件,移动窗口后,图片覆盖控件

vc6.0mfc中使用IPicture接口实现加载jpeg图片,但图片上有控件,移动窗口后,图片覆盖控件,怎么解决图片一直保持在控件之后呢?一下是源代码:
头文件:
IStream m_pStream; //定义流对象
IPicture *m_pPicture; //定义接口对象
OLE_XSIZE_HIMETRIC m_JPGWidth; //图像宽度
OLE_YSIZE_HIMETRIC m_JPGHeight; //图像高度
HGLOBAL hMem; //堆句柄
cpp文件:
该类构造函数下代码:
CFile file;
file.Open("收入支出详情1.jpg",CFile::modeReadWrite);
DWORD len = file.GetLength();
hMem = GlobalAlloc(GMEM_MOVEABLE,len);
LPVOID pData = NULL;
pData = GlobalLock(hMem);
file.ReadHuge(pData,len);
file.Close();
GlobalUnlock(hMem);
CreateStreamOnHGlobal(hMem,TRUE,&m_pStream);
OleLoadPicture(m_pStream,len,TRUE,IID_IPicture,(LPVOID
)&m_pPicture);
m_pPicture->get_Height(&m_JPGHeight);
m_pPicture->get_Width(&m_JPGWidth);
OnPaint函数下代码:

m_pPicture->Render(GetDC()->m_hDC,0,0,(int)(m_JPGWidth/26.45),(int)(m_JPGHeight/26.45),0,m_JPGHeight,m_JPGWidth,-m_JPGHeight,NULL); 
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!