if (!strpointmap.empty()) if (strpointmap[n].Find(L"png") != -1 || strpointmap[n].Find(L"PNG") != -1) { image.Load(strpointmap[n]); CDC* pDialogDC = GetDC(); CRect mrect; CPen pen(PS_SOLID, 3, RGB(200, 200, 200)); CBrush pbrush; pbrush.CreateSolidBrush(RGB(200, 200, 200)); pDialogDC->SelectObject(&pen); pDialogDC->SelectObject(&pbrush); pDialogDC->Rectangle(rectPicture); int mleft = move_x[changenum]; int mright = change_x[changenum] + image.GetWidth(); int mtop = move_y[changenum]; int mbottom = change_y[changenum] + image.GetHeight(); int width = (int)(image.GetWidth() * nScalePercent / 100.0f); int height = (int)(image.GetHeight() * nScalePercent / 100.0f); CBitmap bitmap; bitmap.CreateBitmap(width, height, image.GetBPP(), 1, NULL); CDC* pDC = m_pictureCtrl.GetDC(); CDC memDC; memDC.CreateCompatibleDC(pDC); CBitmap* pOldBitmap = memDC.SelectObject(&bitmap); memDC.SetStretchBltMode(COLORONCOLOR); image.StretchBlt(memDC.GetSafeHdc(), 0, 0, width, height, SRCCOPY); memDC.SelectObject(pOldBitmap); m_pictureCtrl.SetBitmap(bitmap.Detach()); m_nScalePercent = nScalePercent;代码中有错误HGDIOBJ" 类型的实参与 "HBITMAP" 类型的形参不兼容
时间: 2024-02-28 13:54:54 浏览: 89
OpenSource+lpng-1.6.39-x86-64-vc143
这段代码中的错误是将一个 HGDIOBJ 类型的对象作为参数传递给了一个需要 HBITMAP 类型对象的函数。具体来说,是在以下代码中出现的问题:
```C++
memDC.SelectObject(&bitmap);
```
应该将其改为:
```C++
memDC.SelectObject(bitmap);
```
阅读全文