Private void form3_paint (Object sender, system. Windows. Forms. painteventargs E)
{
Graphics G = This. creategraphics ();
Rectangle rect = This. clientrectangle;
// Set the height and width.
Int width = rect. width/2;
Int Height = rect. Height/2;
G. smoothingmode = smoothingmode. antialias;
Fontfamily F = new fontfamily (" ");
Font font = new font (F, 14, fontstyle. Bold, graphicsunit. pixel );
G. translatetransform (width/2, height/2); // the origin is located in the window center.
G. fillellipse (New solidbrush (color. Black), height/-2, height/-2, height, height );
G. drawstring ("km/hour", Font, new solidbrush (color. Green), new pointf (-26, height/-4-font.getheight (0.0f) + 20 ));
G. rotatetransform (225 );
For (INT x = 0; x <55; X ++)
{
G. fillrectangle (New solidbrush (color. Green),-2, (height/2-2) *-1, 3, 15 );
G. rotatetransform (5 );
}
G. resettransform ();
G. translatetransform (width/2, height/2 );
G. rotatetransform (225 );
Int sp = 0;
String TMP;
For (INT x = 0; x <7; X ++)
{
TMP = sp. tostring ();
G. fillrectangle (New solidbrush (color. Red),-3, (height/2-2) *-1, 6, 25 );
G. drawstring (TMP,
Font,
New solidbrush (color. Green), new pointf (TMP. length *-6, (height/-2) + 25 ));
G. rotatetransform (45 );
SP + = 20;
// G. drawstring (
}
G. resettransform ();
G. translatetransform (width/2, height/2 );
Float angle;
Angle = (float) (30.0*2.25) + 225;
G. rotatetransform (angle );
Pen P = new pen (color. Blue, 14 );
P. endcap = linecap. arrowanchor;
P. startcap = linecap. roundanchor;
G. drawline (p, new pointf (0, 0), new pointf (0,-1 * (height/2.75f )));
G. resettransform ();
G. translatetransform (width/2, height/2 );
G. fillellipse (New solidbrush (color. Black),-6,-9, 14, 14 );
G. fillellipse (New solidbrush (color. Red),-7,-7, 14, 14 );
P. width = 4.0f;
P. Color = color. Black;
P. endcap = linecap. Round;
P. startcap = linecap. Flat;
G. drawline (p, new pointf (height/15.75f, height/3.95f), new pointf (height/10.75f, height/5.2f ));
P. Color = color. Red;
G. drawline (p, new pointf (height/15.75f, height/3.95f), new pointf (height/15.75f, height/4.6f ));
G. Dispose ();
}