标签:ret void paint create object his sele client adb
1 void CMyProjetDlg::OnPaint() 2 { 3 4 CPaintDC dc(this);//用于绘制设备的上下文 5 CRect rect; 6 GetClientRect(&rect); //获取对话框长宽 7 CDC dcBmp; //定义并创建一个内存设备环境 8 dcBmp.CreateCompatibleDC(&dc); //创建兼容性DC 9 CBitmap bmpBackground; 10 bmpBackground.LoadBitmap(IDB_BITMAP1); //载入资源中图片 11 BITMAP m_bitmap; 12 bmpBackground.GetBitmap(&m_bitmap); //将图片载入位图中 13 CBitmap *pbmpOld=dcBmp.SelectObject(&bmpBackground); //将位图选入临时内存设备环境 14 dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcBmp,0,0,m_bitmap.bmWidth,m_bitmap.bmHeight,SRCCOPY); 15 //调用函数显示图片 16 17 }
标签:ret void paint create object his sele client adb
原文地址:https://www.cnblogs.com/qiwu1314/p/9388901.html