c# - How to draw with mouse? -
i want make simple mspaint. firstly, draw lines in mouse event.
private void pnl_draw_mousemove(object sender, mouseeventargs e) { if(startpaint) { g = pnl_draw.creategraphics(); g.drawline(p, new point(initx ?? e.x, inity ?? e.y), new point(e.x, e.y)); initx = e.x; inity = e.y; } }
and then, realized resolved if form minimized. however, how use onpaint event it? should store points in list when user click , move, , paint , clear them in onpaint event?
you need keep copy of last image bitmap object. user should update object in memory. can handle onpaint event of canvas display bitmap object background image.
Comments
Post a Comment