Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CDlgRoot::setImageCtl(CStaticEx* wnd, UINT Id)
- {
- if (NULL == Id)
- return;
- Gdiplus::Bitmap* bitmap = CGdiPlusUtil::LoadBitmap(Id);
- if (bitmap == NULL) return;
- CRect ImgCorp;
- wnd->GetWindowRect(&ImgCorp);
- bitmap = getResizeImage(bitmap, ImgCorp.Width(), ImgCorp.Height());
- if (bitmap == NULL) return;
- HBITMAP hBitmap;
- ZeroMemory(&hBitmap, sizeof(HBITMAP));
- bitmap->GetHBITMAP(0, &hBitmap);
- HBITMAP old = wnd->SetBitmap(hBitmap);
- if (NULL != old)
- ::DeleteObject(old);
- //if (!bDefaultImage)
- //{
- ::DeleteObject(hBitmap);
- SAFE_DELETE(bitmap);
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement