Code
HBITMAP bmpHandle = (HBITMAP)LoadImage(NULL,
strPath,
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE);
CBitmap bmpPicture;
CDC mdcPicture;
CBitmap *bmpFromHandle = bmpPicture.FromHandle(bmpHandle);
CRect rctPicture;
m_picSelect.GetWindowRect(&rctPicture);
mdcPicture.CreateCompatibleDC(&dc);
CBitmap * bmpPrevious = mdcPicture.SelectObject(bmpFromHandle);
ScreenToClient(&rctPicture);
dc.BitBlt(rctPicture.left, rctPicture.top,
rctPicture.Width(), rctPicture.Height(),
&mdcPicture, 0, 0, SRCCOPY);
dc.SelectObject(bmpPrevious);
DeleteObject(bmpHandle);
posted @
2009-03-26 15:52
zwicker
阅读(
517)
评论()
编辑
收藏
举报