I try to remove newest drawline.
declaration
Bitmap DrawArea ; // global variable
Bitmap Previuos_DrawArea; // global variable
when I click button to draw a line
private void button2_Click_1(object sender, EventArgs e)
{
Graphics g = Graphics.FromImage(DrawArea);
Previuos_DrawArea_img = DrawArea;
g.(new Pen(Brushes.BlueViolet, 1.0F),0,10,10,20);
pictureBox1.Image = DrawArea;
}
when I click button to remove a line
private void button3_Click_1(object sender, EventArgs e)
{
pictureBox1.Image = Previuos_DrawArea_img;
}
Concept :
1st step - Declare variable.
2nd step - Backup current picture.
3rd step - Draw new picture.
4th step - if undo just draw the backup picture.