标题:C#编五边形?
只看楼主
河阳风月
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2010-5-9
得分:0 
private void Form_Move_Paint(object sender, PaintEventArgs e)
        {
             Bitmap bmp = new Bitmap(ClientSize.Width,ClientSize.Height);
            Graphics hb = Graphics.FromImage(bmp);
            
            for ( int j = 0 ; j < ballArr.GetLength(0) ; j ++ )
            {            
                Point[] pp = { new Point(ballArr[j, 0] + (ballDia1/2), ballArr[j, 1]), new Point(ballArr[j, 0]+ballDia1, ballArr[j, 1]+ballDia3), new Point(ballArr[j, 0]+(ballDia1 / 2 + 20), ballArr[j, 1]+ballDia2), new Point(ballArr[j, 0]+(ballDia1 / 2 - 20), ballArr[j, 1]+ballDia2),new Point(ballArr[j, 0], ballArr[j, 1]+ballDia3) };                                 
                hb.DrawPolygon(new Pen(colorArr[j%12],2),pp);               
            }

            e.Graphics.DrawImage(bmp, 0, 0);
            hb.Dispose();
            bmp.Dispose();
        }

以上是花动态五边形的代码
2010-06-05 11:53
ggminjun
Rank: 2
等 级:论坛游民
威 望:1
帖 子:18
专家分:40
注 册:2010-6-4
得分:0 
感谢,不错的代码
2010-06-07 13:27



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-308638-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.404103 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved