我在一个程序(视图和对话框)中有两个带有窗口的类,它们必须显示图片。
视图从磁盘拍照,如:
CClientDC dc(this);
GetClientRect(&rc);
dcMem.DeleteDC();
hBmp = NULL;;
m_bmpBack.DeleteObject();
hBmp = LoadImage(NULL,"d:/USBconn.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
GetObject ( hBmp, sizeof(bm), &bm );
m_bmpBack.Attach(hBmp);
dcMem.CreateCompatibleDC(&dc);
hbmpOld = (HBITMAP)dcMem.SelectObject(m_bmpBack);
dc.StretchBlt(rc.left, rc.top, rc.right, rc.bottom,&dcMem, 0, 0, (int)bm.bmWidth, (int)bm.bmHeight, SRCCOPY);
如何从这个 dc 中“BitBlt”图像到其他类和窗口中的 dc?