c++ - Rectangle Leaves it mark behind while MouseMove -


i trying create rectangle , colour inverse (area outside rectangle) area.

gdiplus::region *cropregion = new gdiplus::region(croprectf); gdiplus::rect gdicroprect(0.0f, 0.0f, 1000.0f, 1000.0f);  gdiplus::rect imagecontainer(0.0f, 0.0f, 1000.0f, 1000.0f); gdiplus::region *completeregion = new gdiplus::region(imagecontainer); completeregion->intersect(cropregion);  gdigraphics.setclip(completeregion, gdiplus::combinemodexor);  gdiplus::graphicspath *croprectpath = new gdiplus::graphicspath(); croprectpath->addrectangle(croprectf);  gdiplus::pen* mypen = new gdiplus::pen(gdiplus::color::white); mypen->setwidth(1); gdigraphics.drawpath(mypen, croprectpath);  gdiplus::solidbrush dimmingbrush(gdiplus::color::makeargb(50, 0, 0, 0)); gdigraphics.fillregion(&dimmingbrush, completeregion); 

the code till here works fine,

however when try move rectangle using mouse movements in mousemove callback, moves leaves white traces behind.

i tried call invalidaterect in end rectangle doesn't moves @ all. idea how can old rectangle can cleared. using gdi+ , c++. thanks


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -