嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559
本次赞助数额为: 4 元微信扫码支付:4 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
该程序是用C#是做一个会走时的旋转时钟
private void DrawBmp(Graphics g)
{
g.Clear(Control.DefaultBackColor);
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
//draw fram
Pen pen = new Pen(framecolor, 2.5f); //画笔画圆颜色和粗细
g.DrawEllipse(pen, center.X - radius, center.Y - radius, radius * 2, radius * 2); //圆外形尺寸
//画小时
double hourRad = Math.PI * 2 / 12;
double hour_rad = 0;
for (int i = 1; i <= 12; i )
{
//画时钟刻度线
hour_rad = hourRad * i;
PointF p1 = new PointF(center.X radius * (float)Math.Sin(hour_rad), center.Y - radius * (float)Math.Cos(hour_rad));
PointF p2 = new PointF(center.X (radius - 8) * (float)Math.Sin(hour_rad), center.Y - (radius - 8) * (float)Math.Cos(hour_rad));
g.DrawLine(pen, p1, p2);
//画小时数字
p2 = new PointF(center.X (radius - 20) * (float)Math.Sin(hour_rad), center.Y - (radius - 20) * (float)Math.Cos(hour_rad));
Font font = new Font("宋体", 12);
SizeF size = g.MeasureString(i.ToString(), font);
p2.X -= size.Width / 2;
p2.Y -= size.Height / 2;
g.DrawString((i).ToString(), font, Brushes.Black, p2);
}