Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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...


C++
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();
Posted

1 solution

may be
CRect(vLeft, vTop, vLeft+vWdith, vTop+vHeight);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900