惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
罗磊的独立博客
T
The Blog of Author Tim Ferriss
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
Last Week in AI
Last Week in AI
美团技术团队
Google Online Security Blog
Google Online Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
D
Docker
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
月光博客
月光博客
L
LINUX DO - 最新话题
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
W
WeLiveSecurity
H
Heimdal Security Blog
Vercel News
Vercel News
SecWiki News
SecWiki News
Forbes - Security
Forbes - Security
Blog — PlanetScale
Blog — PlanetScale
Google DeepMind News
Google DeepMind News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
T
Troy Hunt's Blog
A
About on SuperTechFans
C
Check Point Blog
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
AI
AI
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
博客园_首页
The Last Watchdog
The Last Watchdog
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
I
Intezer
K
Kaspersky official blog
M
MIT News - Artificial intelligence
J
Java Code Geeks
G
GRAHAM CLULEY
P
Palo Alto Networks Blog

博客园 - dfsafdas

C清空输入缓冲区 验证视图状态 MAC 失败。如果此应用程序由网络场或群集承载,请确保 <machineKey> 配置指定了相同的 validationKey 和验证算法。不能在群集中使用 AutoGenerate。 标记为可序列化 安装完vs2008中文的sp1后,智能提示变成英文. rootkit 直接访问硬件(转自看雪) XNA做的一个游戏. 最新的.Net TcpSocket修正,加入边界的处理. 编译qt-win-commercial-src-4.3.0全过程。 .Net TcpSocket组件,重新修正。 模仿DELPHI的SOCKET组件封装的.Net的Socket组件.-_- 时间格式转换(转) 对.Net 垃圾回收Finalize 和Dispose的理解 Is Design Dead?中文版 最近封装了一个TCP组件。 简单有趣的截屏-_- 有意思的张飞日记-_- HOOK介绍 Visual C#调用Windows API函数 水晶报表的部署。
饼图的绘制
dfsafdas · 2006-04-22 · via 博客园 - dfsafdas


        private Color selectcolor=Color.Green;
        
private ArrayList duixiang=new ArrayList();

        
private void button3_Click(object sender, System.EventArgs e)
        
{
            
float data=0;
            
try
            
{
                data
=float.Parse(this.textBox1.Text);
            }

            
catch{}
            Class1 cl1
=new Class1(data,selectcolor);  
            duixiang.Add(cl1);  
//将新对象添加进duixiang.
            this.draw(); //绘制

            Random rand 
= new Random();

            
this.selectcolor = Color.FromArgb(rand.Next(255), rand.Next(255), rand.Next(255));
            
this.label1.BackColor = this.selectcolor;
            
this.label1.Text=selectcolor.Name.ToString();

        
        }


        
private void draw()
        
{
            
float startangle=0.0f;   //开始角度
            float total=0.0f;        //总体数据。
            Graphics gs=this.panel1.CreateGraphics();
            Rectangle rect 
= new Rectangle(10,10,150,150); //定义矩形位置大小
            foreach(Class1 cl1 in duixiang)
            
{
                total
+=cl1.share;      //计算总体的数据
            }

            gs.Clear(
this.panel1.BackColor);
            
for (int i=0;i<duixiang.Count;i++)
            
{
                Class1 cls
=(Class1)duixiang[i];
                
float endangle=cls.share/total *360;   //结束绘制的角度.
                Pen pen = new Pen(this.panel1.BackColor);
                SolidBrush sBrush 
= new SolidBrush(cls.color);
                gs.DrawArc(pen,rect,startangle,endangle);  
//绘制弧线
                gs.FillPie(sBrush,rect,startangle,endangle); //填充扇形
                startangle += endangle;     //重新计算开始绘制的角度
            }

        }






    
public class Class1
    
{
        
public float share; 
        
public Color color;
        
public Class1(float share,Color color)
        
{
            
this.share=share;
            
this.color=color;
        }

    }