4个回答
展开全部
g = e.Graphics;
//绘图模式默认为粗糙模式,将会出现锯齿!
g.SmoothingMode = SmoothingMode.AntiAlias;
g.SmoothingMode = SmoothingMode.HighQuality;
g.TranslateTransform(w / 2, h / 2);//重新设置坐标原点
//获得系统时间值
int second = DateTime.Now.Second;
int minute = DateTime.Now.Minute;
int hour = DateTime.Now.Hour;
/*------------------------------------------------------------------------------------
每秒偏移度,秒针偏移=当前秒*6
每分偏移读,分针偏移= 当前分*6+当前秒*(/60)
每小时偏移读,时针偏移= 当前时*30+当前分*(/60)+当前秒*(/60/60)
--------------------------------------------------------------------------------------*/
//绘秒针
pen = new Pen(Color.FromArgb(121, 151, 188), 1);
pen.EndCap = LineCap.RoundAnchor;
g.RotateTransform(6 * second);
float y = (float)((-1) * (h / 2.75));
g.DrawLine(pen, new PointF(0, 0), new PointF((float)0, y));
////绘分针
pen = new Pen(Color.FromArgb(147, 162, 180), 4);
pen.EndCap = LineCap.Round;
g.RotateTransform(-6 * second); //恢复系统偏移量,再计算下次偏移
g.RotateTransform((float)(second * 0.1 + minute * 6));
y = (float)((-1) * ((h - 20) / 2.75));
g.DrawLine(pen, new PointF(0, 0), new PointF((float)0, y));
////绘时针
pen = new Pen(Color.FromArgb(90, 94, 96), 6);
pen.EndCap = LineCap.Round;
g.RotateTransform((float)(-second * 0.1 - minute * 6));//恢复系统偏移量,再计算下次偏移
g.RotateTransform((float)(second * 0.01 + minute * 0.1 + hour * 30));
y = (float)((-1) * ((h - 35) / 2.75));
g.DrawLine(pen, new PointF(0, 0), new PointF((float)0, y));
//绘图模式默认为粗糙模式,将会出现锯齿!
g.SmoothingMode = SmoothingMode.AntiAlias;
g.SmoothingMode = SmoothingMode.HighQuality;
g.TranslateTransform(w / 2, h / 2);//重新设置坐标原点
//获得系统时间值
int second = DateTime.Now.Second;
int minute = DateTime.Now.Minute;
int hour = DateTime.Now.Hour;
/*------------------------------------------------------------------------------------
每秒偏移度,秒针偏移=当前秒*6
每分偏移读,分针偏移= 当前分*6+当前秒*(/60)
每小时偏移读,时针偏移= 当前时*30+当前分*(/60)+当前秒*(/60/60)
--------------------------------------------------------------------------------------*/
//绘秒针
pen = new Pen(Color.FromArgb(121, 151, 188), 1);
pen.EndCap = LineCap.RoundAnchor;
g.RotateTransform(6 * second);
float y = (float)((-1) * (h / 2.75));
g.DrawLine(pen, new PointF(0, 0), new PointF((float)0, y));
////绘分针
pen = new Pen(Color.FromArgb(147, 162, 180), 4);
pen.EndCap = LineCap.Round;
g.RotateTransform(-6 * second); //恢复系统偏移量,再计算下次偏移
g.RotateTransform((float)(second * 0.1 + minute * 6));
y = (float)((-1) * ((h - 20) / 2.75));
g.DrawLine(pen, new PointF(0, 0), new PointF((float)0, y));
////绘时针
pen = new Pen(Color.FromArgb(90, 94, 96), 6);
pen.EndCap = LineCap.Round;
g.RotateTransform((float)(-second * 0.1 - minute * 6));//恢复系统偏移量,再计算下次偏移
g.RotateTransform((float)(second * 0.01 + minute * 0.1 + hour * 30));
y = (float)((-1) * ((h - 35) / 2.75));
g.DrawLine(pen, new PointF(0, 0), new PointF((float)0, y));
展开全部
没有看懂楼主要什么!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
是画十字线吗?带见图的那种,你把这个线作成图片,就是很系到和线一样,你把这个话上去就是坐标了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
坐标纸?还是只是坐标的两个轴
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询