panel - double buffered in c# -
possible duplicates:
how double buffer panel in c#?
c# panel drawing graphics , scrolling
i draw bitmap on panel, use zooming on same panel. while zooming panel continuously flickering. why not panel have doublebuffered property?
code:
graphics g = graphics.fromhwnd(panel.handle); if (newimage == true) { g.clear(systemcolors.control); newimage = false; } g.drawimage(bmp, hoffset, voffset); g.dispose();
add code inside constructor
this.setstyle(controlstyles.allpaintinginwmpaint |controlstyles.userpaint |controlstyles.doublebuffer, true);
Comments
Post a Comment