|
Upstairs hello
Thank you for your reply.
For the problem of "copying bitmaps", I found the information on the Internet, and finally I wrote it like this. Can you help me to see if it can be optimized?
CBitmap bitmap;
CClientDC dc (GetDlgItem (IDC_WAVE_UI_BMP));
CDC memDC;
CRect rect (0, 0, 0, 0);
VERIFY (memDC.CreateCompatibleDC (&dc));
GetDlgItem (IDC_WAVE_UI_BMP)-> GetWindowRect (rect);
Ranch
VERIFY (bitmap.CreateCompatibleBitmap (&dc, rect.Width (), rect.Height ()));
CBitmap * pOldBitmap = memDC.SelectObject (&bitmap);
VERIFY (memDC.BitBlt (0, 0, rect.Width (), rect.Height (),&dc, 0, 0, SRCCOPY));
Ranch
VERIFY (:: OpenClipboard (NULL));
VERIFY (:: EmptyClipboard ());
VERIFY (SetClipboardData (CF_BITMAP, bitmap.GetSafeHandle ()));
:: CloseClipboard ();
Ranch
memDC.SelectObject (pOldBitmap);
bitmap.Detach ();
The bitmap is displayed on the Picture control whose DI is "IDC_WAVE_UI_BMP". |
|