本文介绍了用C ++绘制图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 此代码有任何问题吗?当我绘制多个图像时,它们似乎已被破坏,几乎就像图像被另一个图像覆盖一样...... CImage myImage; myImage.Load(my_symbol-> outfile); int vWidth = myImage.GetWidth(); int vHeight = myImage.GetHeight(); CRect m_ShowDRect; m_ShowDRect = CRect(vLeft,vTop,vWdith,vHeight); myImage.Draw(pDC-> m_hDC,CRect(& m_ShowDRect)); int old = pDC-> SetROP2(R2_NOTXORPEN); pDC-> Rectangle(m_ShowDRect); pDC-> SetROP2(旧); myImage.Destroy(); 解决方案 可能是 CRect(vLeft,vTop, vLeft + vWdith,vTop + vHeight); Any issues with this code? when I draw multiple images, they seem to get corrupted, almost as if the image is overwritten by another image... CImage myImage; myImage.Load(my_symbol->outfile); int vWidth = myImage.GetWidth(); int vHeight = myImage.GetHeight(); CRect m_ShowDRect; m_ShowDRect = CRect(vLeft, vTop, vWdith, vHeight); myImage.Draw(pDC->m_hDC, CRect(&m_ShowDRect)); int old = pDC->SetROP2(R2_NOTXORPEN); pDC->Rectangle(m_ShowDRect); pDC->SetROP2(old); myImage.Destroy(); 解决方案 may beCRect(vLeft, vTop, vLeft+vWdith, vTop+vHeight); 这篇关于用C ++绘制图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-15 10:10