using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Point pt0 = new Point(10, 10);
int width = 50;
var g = pictureBox1.CreateGraphics();
g.Clear(Color.White);
var pen = new Pen(Color.White);
var brush = new SolidBrush(Color.White);
g.DrawRectangle(pen, pt0.X, pt0.Y, width * 10, width * 6);
var a = this.pictureBox1.CreateGraphics();
var p = new Pen(Color.Black);
brush.Color = Color.Green;
Rectangle[] rects = new Rectangle[3];
Point point1 = new Point(10, 10);
Point point2 = new Point(250, 160);
Point point3 = new Point(10, 310);
Point[] pntArr = { point1, point2, point3 };
g.FillPolygon(Brushes.Green, pntArr);
}
}
}