如何设计技能向导图

说明:请忽略label标签!

开发功能思路:根据数据库传来的考核数据对每个人的成绩进行单独显示,同时通过比率的方式传给技能框图。 

开发步骤:

1.设计五星图,主要外框部分是通过直线绘制,内部是通过射线绘制;

参考代码:

 Bitmap bt = new Bitmap(groupBox2.Width, groupBox2.Height);           //实例化一个Bitmap对象
            g = Graphics.FromImage(bt);                                                   //实例化Graphics对象
            Pen p1 = new Pen(Color.Red, 1);                                             //设置Pen对象用来绘画X轴
            Pen p2 = new Pen(Color.LightSkyBlue, 1);                                             //设置Pen对象用来绘画X轴
            g.DrawLine(p2, new Point(groupBox2.Width/2,  50), new Point(groupBox2.Width / 2+100, 125));         
            g.DrawLine(p2, new Point(groupBox2.Width / 2, 50), new Point(groupBox2.Width / 2 - 100, 125));         
            g.DrawLine(p2, new Point(groupBox2.Width / 2-100, 125), new Point(groupBox2.Width / 2 -70 , 250));         
            g.DrawLine(p2, new Point(groupBox2.Width / 2 +100, 125), new Point(groupBox2.Width / 2 +70, 250));         
            g.DrawLine(p2, new Point(groupBox2.Width / 2 - 70, 250), new Point(groupBox2.Width / 2 + 70, 250));
            // 绘制连接线
            g.DrawLine(p2, new Point(groupBox2.Width / 2, 155), new Point(groupBox2.Width / 2, 50));
            g.DrawLine(p2, new Point(groupBox2.Width / 2 ,155), new Point(groupBox2.Width / 2 + 100, 125));
            g.DrawLine(p2, new Point(groupBox2.Width / 2, 155), new Point(groupBox2.Width / 2 - 100, 125));
            g.DrawLine(p2, new Point(groupBox2.Width / 2, 155), new Point(groupBox2.Width / 2 - 70, 250));
            g.DrawLine(p2, new Point(groupBox2.Width / 2, 155), new Point(groupBox2.Width / 2 + 70, 250));
            groupBox2.BackgroundImage = bt;

 关于函数内部的数据,请按照标准定义编写;

2.绘制五星实图,通过函数g.FillPolygon( );进行绘制,内部只需要传入参数即可;

参考代码:

Point point1 = new Point(groupBox2.Width / 2, 60);
Point point2 = new Point(groupBox2.Width / 2 - 100, 125);
Point point3 = new Point(groupBox2.Width / 2 + 100, 125);
Point point4 = new Point(groupBox2.Width / 2 - 70, 250);
Point point5 = new Point(groupBox2.Width / 2 + 70, 250);
Point[] pntArr = { point1, point2, point4, point5, point3 };
g.FillPolygon(Brushes.Honeydew, pntArr);

请注意,此步骤需要内部逻辑判断进行测试;

以上!

Copyright [2019/8/13] by [Masir]

知识星球

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值