C#绘制饼图的简单方法
来源:互联网 发布:架设代理服务器软件 编辑:程序博客网 时间:2024/05/07 10:47
Graphics.FillPie 方法
float startAngle=270;
SolidBrush MyBrush;
Graphics g=this.pnlPctImg.CreateGraphics();
g.Clear(this.BackColor);
MyBrush=new SolidBrush(Color.Red);
g.FillPie(MyBrush,2,2,120,120,startAngle,(a/100)*360);
startAngle+=(a/100)*360;
MyBrush=new SolidBrush(Color.Blue);
g.FillPie(MyBrush,2,2,120,120,startAngle,(b/100)*360);
startAngle+=(b/100)*360;
MyBrush=new SolidBrush(Color.Green);
g.FillPie(MyBrush,2,2,120,120,startAngle,(c/100)*360);
startAngle+=(c/100)*360;
MyBrush=new SolidBrush(Color.Pink);
g.FillPie(MyBrush,2,2,120,120,startAngle,(d/100)*360);
g.Dispose();
参数
- brush
- 确定填充特性的 Brush 对象。
- x
- 边框左上角的 x 坐标,该边框定义扇形区所属的椭圆。
- y
- 边框左上角的 y 坐标,该边框定义扇形区所属的椭圆。
- width
- 边框的宽度,该边框定义扇形区所属的椭圆。
- height
- 边框的高度,该边框定义扇形区所属的椭圆。
- startAngle
- 从 x 轴沿顺时针方向旋转到扇形区第一个边所测得的角度(以度为单位)。
- sweepAngle
- 从 startAngle 参数沿顺时针方向旋转到扇形区第二个边所测得的角度(以度为单位)。
float startAngle=270;
SolidBrush MyBrush;
Graphics g=this.pnlPctImg.CreateGraphics();
g.Clear(this.BackColor);
MyBrush=new SolidBrush(Color.Red);
g.FillPie(MyBrush,2,2,120,120,startAngle,(a/100)*360);
startAngle+=(a/100)*360;
MyBrush=new SolidBrush(Color.Blue);
g.FillPie(MyBrush,2,2,120,120,startAngle,(b/100)*360);
startAngle+=(b/100)*360;
MyBrush=new SolidBrush(Color.Green);
g.FillPie(MyBrush,2,2,120,120,startAngle,(c/100)*360);
startAngle+=(c/100)*360;
MyBrush=new SolidBrush(Color.Pink);
g.FillPie(MyBrush,2,2,120,120,startAngle,(d/100)*360);
g.Dispose();
- C#绘制饼图的简单方法
- c# GDI绘制简单的艺术字
- C# 绘制饼图
- C#绘制图片的几个处理方法
- C#绘制曲线图和柱状图的方法
- C# Winform中绘制动画的方法
- C#绘制各种统计图的实现方法
- C#绘制各种统计图的实现方法
- Silverlight里C#绘制Path的方法
- C#绘制的几种方法
- 简单绘制图片为圆形的方法
- 绘制3D饼图的方法
- C#绘制柱状图饼图
- C#学习笔记之使用GDI绘制简单的图形
- C#简单的方法调用
- C#方法的简单总结
- asp.net 简单数据的直方图 饼图绘制参考
- 一种比较简单的绘制半透明多边形的方法
- javascript常用代码
- jdbc---mysql
- proxool连接池在tomcat+mysql环境下的配置
- 使用属性文件为mysql数据库配连接池proxool
- MySQL5.0中文问题及JDBC数据库连接和JSP汉字编码问题解决方法总结
- C#绘制饼图的简单方法
- 制作用户手册的方法
- 把业务需求转换为IT要求
- javascript关闭窗口
- 接口和抽象类的理解
- linux下的多线程编程
- 确定测试计划
- window.close
- 人生的35个好习惯