创建轨迹梯度,渐变五角星,C#源代码

时间:2012-01-21 05:08:32
【文件属性】:

文件名称:创建轨迹梯度,渐变五角星,C#源代码

文件大小:33KB

文件格式:RAR

更新时间:2012-01-21 05:08:32

创建轨迹梯度,渐变五角星,C#源代码

创建轨迹梯度,渐变五角星,C#源代码 // Put the points of a polygon in an array. Point[] points = { new Point(75, 0), new Point(100, 50), new Point(150, 50), new Point(112, 75), new Point(150, 150), new Point(75, 100), new Point(0, 150), new Point(37, 75), new Point(0, 50), new Point(50, 50)}; // Use the array of points to construct a path. GraphicsPath path = new GraphicsPath(); path.AddLines(points); // Use the path to construct a path gradient brush. PathGradientBrush pthGrBrush = new PathGradientBrush(path); // Set the color at the center of the path to red. pthGrBrush.CenterColor = Color.FromArgb(255, 255, 0, 0); // Set the colors of the points in the array. Color[] colors = { Color.FromArgb(255, 0, 0, 0), Color.FromArgb(255, 0, 255, 0), Color.FromArgb(255, 0, 0, 255), Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 0, 0, 0), Color.FromArgb(255, 0, 255, 0), Color.FromArgb(255, 0, 0, 255), Color.FromArgb(255, 255, 255, 255), Color.FromArgb(255, 0, 0, 0), Color.FromArgb(255, 0, 255, 0)}; pthGrBrush.SurroundColors = colors; // Fill the path with the path gradient brush. e.Graphics.FillPath(pthGrBrush, path); VisualStudio2008创建


【文件预览】:
fiveStar
----fiveStar.sln(914B)
----fiveStar.suo(13KB)
----新建 文本文档.txt(2KB)
----fiveStar()
--------Form1.cs(2KB)
--------bin()
--------obj()
--------fiveStar.csproj(4KB)
--------Properties()
--------Program.cs(489B)
--------Form1.Designer.cs(1KB)
--------Form1.resx(6KB)

网友评论

  • 思路不错!可做参考