, Visual C#



54.1. .

// "angle"

// :

int angle = 0;

private void pictureBox1_Paint(object sender,

PaintEventArgs e)

{

// myGraphicsPath GraphicsPath:

GraphicsPath myGraphicsPath = new GraphicsPath();

// myGraphicsPath

//AddLine

// (29, 29) (100, 100):

myGraphicsPath.AddLine(29, 29, 100, 100);

// Matrix myMatrix

// :

Matrix myMatrix = new Matrix(1, 0, 0, 1, 1, 1);

 

// PointF myPointF

// (100, 100);,

// :

PointF myPointF = new PointF(100, 100);

 

// (100, 100)

// RotateAt

// Matrix:

myMatrix.RotateAt(angle, myPointF);

 

// Transform GraphicsPath

// myMatrix:

myGraphicsPath.Transform(myMatrix);

 

//

// 3 (Pen(Color.Black, 3)):

e.Graphics.DrawPath(new Pen(Color.Black, 3),

myGraphicsPath);

 

//

// , 6 :

angle = angle + 6;

 

// ,

// 360 :

if (angle == 360) angle = 0;

 

// 200x200

// ( )

// 2 (Pen(Color.Blue, 2),

// :

e.Graphics.DrawEllipse(new Pen(Color.Blue, 2),

0, 0, 200, 200);