c# - Drawing on a Picturebox with an image in it and saving it -
i'm working on program take anvanced screenshots. i'm stuck bug, hope can me.
i can make screenshots code:
// screenshot stored in bitmap. bitmap capture = new bitmap(screenbounds.width, screenbounds.height); // code below takes screenshot , // saves in "capture" bitmap. g = graphics.fromimage(capture); g.copyfromscreen(point.empty, point.empty, screenbounds); // code assigns screenshot // picturebox can view picturebox1.image = capture; picturebox1.sizemode = pictureboxsizemode.stretchimage; // code below make form visible again, enables "save" button , stops timer. this.show(); button2.enabled = true; timer1.stop();
drawing on picturebox:
color = new solidbrush(color.black); graphics g = picturebox1.creategraphics(); g.fillellipse(color, e.x, e.y, 10, 10); g.dispose();
the problem: can save screenshot, not drawings.
hope can
ps: if don't understand hole thing, i'm 14 , netherlands, i'm not best english writer.
don't use creategraphics()
- that's temporary drawing. use capture image:
using (graphics g = graphics.fromimage(capture)) { g.fillellipse(color, e.x, e.y, 10, 10); }
Comments
Post a Comment