using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace rotation
{
public partial class Form1 : Form
{
float f = 0;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Interval = 1000;
this.Refresh();
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawEllipse(Pens.Red, 0, 0, 220, 220);
GraphicsPath gp = new GraphicsPath();
gp.AddLine(30, 30, 110, 110);
Matrix matricx = new Matrix(1, 0, 0, 1, 1, 1);
PointF rp = new PointF(110.0f, 110.0f);
matricx.RotateAt(f, rp);
gp.Transform(matricx);
e.Graphics.DrawPath(Pens.Blue, gp);
f = f + 6;
if (f == 360)
f = 0;
}
}
}