using GraphicsPath hoursHandGraphicsPat new GraphicsPath hoursHandGrap

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
using(GraphicsPath hoursHandGraphicsPath = new GraphicsPath()) {
hoursHandGraphicsPath.AddPolygon(
new PointF[] {
ViewInfo.CenterPoint,
new PointF(
(float)(Math.Cos(ViewInfo.HoursRadian + Math.PI / 180 * 10) * ViewInfo.HourHandRadius / 2 + ViewInfo.CenterPoint.X),
(float)(Math.Sin(ViewInfo.HoursRadian + + Math.PI / 180 * 10) * ViewInfo.HourHandRadius / 2 + ViewInfo.CenterPoint.Y)
),
new PointF(
(float)(Math.Cos(ViewInfo.HoursRadian) * ViewInfo.HourHandRadius + ViewInfo.CenterPoint.X),
(float)(Math.Sin(ViewInfo.HoursRadian) * ViewInfo.HourHandRadius + ViewInfo.CenterPoint.Y)
),
new PointF(
(float)(Math.Cos(ViewInfo.HoursRadian - Math.PI / 180 * 10) * ViewInfo.HourHandRadius / 2 + ViewInfo.CenterPoint.X),
(float)(Math.Sin(ViewInfo.HoursRadian - Math.PI / 180 * 10) * ViewInfo.HourHandRadius / 2 + ViewInfo.CenterPoint.Y)
)
}
);
graphics.FillPath(Brushes.LightSlateGray, hoursHandGraphicsPath);
graphics.DrawPath(Pens.Black, hoursHandGraphicsPath);
}