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;
using System.Drawing.Drawing2D;
using System.Timers;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
Matrix mat = new Matrix(0f, 1f, -1f, 0f, 0f, 0f);
Point[] pt = new Point[3] { new Point(0, 0), new Point(100, 0), new Point(100, 100)};
public Form1()
{
InitializeComponent();
timer1.Interval = 500;
timer1.Start();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
g.TranslateTransform(this.ClientRectangle.Width / 2, this.ClientRectangle.Height / 2);
mat.TransformPoints(pt);
g.DrawPolygon(new Pen(Color.Black, 10), pt);
}
private void timer1_Tick(object sender, EventArgs e)
{
this.Invalidate();
}
}
}