Using system;
Using system. Data;
Using system. drawing;
Using system. Drawing. drawing2d;
Namespace WebService
{
Class clock
{
Private point mickeymouse = new point (0, 0 );
Public void drawclock (Graphics g)
{
/// Center (120,130 );
Rectangle outrect = new rectangle (0, 0,240,260 );
Rectangle midrect = new rectangle (7, 7,226,246 );
Rectangle inrect = new rectangle (10, 10,220,240 );
Lineargradientbrush outlbluebrush = new lineargradientbrush (outrect, color. fromargb (0, 0,100 ),
Color. fromargb (0, 0,255), lineargradientmode. backwarddiagonal );
Lineargradientbrush midlbluebrush = new lineargradientbrush (midrect, color. fromargb (0, 0,255 ),
Color. fromargb (0, 0,100), lineargradientmode. backwarddiagonal );
Lineargradientbrush inlbluebrush = new lineargradientbrush (inrect, color. fromargb (0, 0,100 ),
Color. fromargb (0, 0,255), lineargradientmode. backwarddiagonal );
G. fillellipse (outlbluebrush, outrect );
G. fillellipse (midlbluebrush, midrect );
G. fillellipse (inlbluebrush, inrect );
Outlbluebrush. Dispose ();
Midlbluebrush. Dispose ();
Inlbluebrush. Dispose ();
Font myfont = new font ("Arial", 20, fontstyle. Bold );
Solidbrush whitebrush = new solidbrush (color. White );
G. drawstring ("12", myfont, whitebrush, 100, 10 );
G. drawstring ("6", myfont, whitepaint, 110,223 );
G. drawstring ("3", myfont, whitepaint, 210,120 );
G. drawstring ("9", myfont, whitepaint, 10,120 );
G. drawstring ("1", myfont, whitebrush, 160, 26 );
G. drawstring ("2", myfont, whitebrush, 194, 64 );
G. drawstring ("5", myfont, whitepaint, 156,210 );
G. drawstring ("4", myfont, whitepaint, 192,174 );
G. drawstring ("11", myfont, whitebrush, 55, 28 );
G. drawstring ("10", myfont, whitebrush, 22, 66 );
G. drawstring ("7", myfont, whitepaint, 64,210 );
G. drawstring ("8", myfont, whitepaint, 28,174 );
Myfont. Dispose ();
Whitebrush. Dispose ();
// Datetime;
G. translatetransform (120,130, matrixorder. append );
Pen hourpen = new pen (color. White, 6 );
Hourpen. setlinecap (linecap. roundanchor, linecap. arrowanchor, dashcap. Flat );
Pen minutepen = new pen (color. White, 4 );
Minutepen. setlinecap (linecap. roundanchor, linecap. arrowanchor, dashcap. Flat );
Pen secondpen = new pen (color. Red, 2 );
Int sec = datetime. Now. Second;
Int min = datetime. Now. minute;
Int hour = datetime. Now. hour;
Double secondangle = 2.0 * Math. Pi * SEC/60.0;
Double minuteangle = 2.0 * Math. Pi * (min + SEC/60.0)/60.0;
Double hourangle = 2.0 * Math. Pi * (hour + min/60.0)/12.0;
Point center = new point (0, 0 );
Point hourhand = new point (INT) (40 * Math. Sin (hourangle )),
(INT) (-40 * Math. Cos (hourangle )));
G. drawline (hourpen, center, hourhand );
Point minhand = new point (INT) (80 * Math. Sin (minuteangle )),
(INT) (-80 * Math. Cos (minuteangle )));
G. drawline (minutepen, center, minhand );
Point sechand = new point (INT) (80 * Math. Sin (secondangle )),
(INT) (-80 * Math. Cos (secondangle )));
G. drawline (secondpen, center, sechand );
Hourpen. Dispose ();
Minutepen. Dispose ();
Secondpen. Dispose ();
}
// Private void timereffectick (Object sender, eventargs E)
//{
// This. invalidate ();
//}
// Private void hidetoolstripmenuitem_click (Object sender, eventargs E)
//{
// If (contextmenustrip1.items [0]. tostring () = "hide ")
//{
// This. Hide ();
// Contextmenustrip1.items [0]. Text = "show ";
// Return;
//}
// If (contextmenustrip1.items [0]. tostring () = "show ")
//{
// This. Show ();
// Contextmenustrip1.items [0]. Text = "hide ";
// Return;
//}
//}
// Private void form=mousedown (Object sender, mouseeventargs E)
//{
// Mickeymouse = new point (-E. X,-E. y );
//}
// Private void form=mousemove (Object sender, mouseeventargs E)
//{
// If (E. Button = mousebuttons. Left)
//{
// Point mousepos = control. mouseposition;
// Mousepos. offset (mickeymouse. X, mickeymouse. y );
// Location = mousepos;
//}
//}
// Private void policyicon#doubleclick (Object sender, eventargs E)
//{
// If (contextmenustrip1.items [0]. tostring () = "show ")
//{
// This. Show ();
// Contextmenustrip1.items [0]. Text = "hide ";
// Return;
//}
//}
}
}