//When clear button is clicked it clears the Canvas. private void Clearbutton_Click(object sender, EventArgs e) { Canvaspanel.Invalidate(); //Clears all our data structures that hold the current lines and shapes on the canvas. SBuilder.ClearListsOfShapes(); }
//Painter form constructor. public PainterForm() { InitializeComponent(); //Creates graphics variable that is linked to the canvas we draw on. graphics = Canvaspanel.CreateGraphics(); //Create and instance of the class that holds all the objects we need to use, pen, graphics etc. SBuilder = new ShapesBuilder(graphics); //Hide the dimensions sections, since the default drawing setting is drawing lines. HideDimensionsSection(); }