using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace multiple
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void LineButton_Click(object sender, EventArgs e)
{
int x1, y1, x2, y2;
Graphics DrawInterface = panel1.CreateGraphics();
Pen MyPenBlack = new Pen(Color.Black, 5);
x1 = Convert.ToInt32(textBox1.Text);
y1 = Convert.ToInt32(textBox2.Text);
x2 = Convert.ToInt32(textBox3.Text);
y2 = Convert.ToInt32(textBox4.Text);
Point A = new Point(x1, y1);
Point B = new Point(x2, y2);
DrawInterface.Clear(Color.LightGray);
DrawInterface.DrawLine(MyPenBlack, A, B);
}
private void PictureCircle_Click(object sender, EventArgs e)
{
int x1, y1, x2, y2;
Graphics DrawInterface = panel1.CreateGraphics();
Pen MyPenRed = new Pen(Color.Red, 5);
x1 = Convert.ToInt32(textBox1.Text);
y1 = Convert.ToInt32(textBox2.Text);
x2 = Convert.ToInt32(textBox3.Text);
y2 = Convert.ToInt32(textBox4.Text);
Rectangle temp = new Rectangle(x1, y1, x2, y2);
DrawInterface.Clear(Color.LightGray);
DrawInterface.DrawEllipse(MyPenRed, temp);
}
private void PictureRectangle_Click(object sender, EventArgs e)
{
int x1, y1, x2, y2;
Graphics DrawInterface = panel1.CreateGraphics();
Pen MyPenBlue = new Pen(Color.Blue, 5);
x1 = Convert.ToInt32(textBox1.Text);
y1 = Convert.ToInt32(textBox2.Text);
x2 = Convert.ToInt32(textBox3.Text);
y2 = Convert.ToInt32(textBox4.Text);
Rectangle tempRect = new Rectangle(x1, y1, x2, y2);
DrawInterface.Clear(Color.LightGray);
DrawInterface.DrawRectangle(MyPenBlue, tempRect);
}
private void PicturePie_Click(object sender, EventArgs e)
{
int x1, y1, x2, y2;
Graphics DrawInterface = panel1.CreateGraphics();
Pen MyPenOrange = new Pen(Color.Orange, 5);
x1 = Convert.ToInt32(textBox1.Text);
y1 = Convert.ToInt32(textBox2.Text);
x2 = Convert.ToInt32(textBox3.Text);
y2 = Convert.ToInt32(textBox4.Text);
Rectangle temp = new Rectangle(x1, y1, x2, y2);
DrawInterface.Clear(Color.LightGray);
DrawInterface.DrawPie(MyPenOrange, temp, 90, 270);
}
}
}