Beispiel #1
0
 public void Draw(Form form, GeometricRectangle rectangle)
 {
     var myBrush = new SolidBrush(System.Drawing.Color.Black);
     var formGraphics = form.CreateGraphics();
     formGraphics.Clear(form.BackColor);
     formGraphics.DrawRectangle(Pens.Black, 5, 5, rectangle.Width, rectangle.Height);
 }
Beispiel #2
0
        private void buttonDraw_Click(object sender, EventArgs e)
        {
            var rectangle = new GeometricRectangle(int.Parse(textWidth.Text), int.Parse(textHeight.Text));

            MessageBox.Show("Area : " + rectangle.Area().ToString());
            var service = new GraphicService();

            service.Draw(this, rectangle);
        }