日期:2014-05-18  浏览次数:20836 次

如何定义圆形渐变(中间——边缘渐变)画笔,类似Photoshop里的画笔工具
如何定义圆形渐变(中间——边缘渐变)画笔,类似Photoshop里的画笔工具

------解决方案--------------------
今天早上的目的是把0回复的顶起来
------解决方案--------------------
有个叫PaintDotNet的C#开源项目,类似Photoshop,楼主可以去搜搜参考一下
------解决方案--------------------
帮你顶
------解决方案--------------------
http://download.csdn.net/source/167724
------解决方案--------------------
下面的示例用路径渐变画笔填充椭圆。中心的颜色设置为蓝色;边界的颜色设置为浅绿色。

C# code
// Create a path that consists of a single ellipse. 
GraphicsPath path = new GraphicsPath();
path.AddEllipse(0, 0, 140, 70);

// Use the path to construct a brush.
PathGradientBrush pthGrBrush = new PathGradientBrush(path);

// Set the color at the center of the path to blue.
pthGrBrush.CenterColor = Color.FromArgb(255, 0, 0, 255);

// Set the color along the entire boundary
// of the path to aqua.
Color[] colors = {Color.FromArgb(255, 0, 255, 255)};
pthGrBrush.SurroundColors = colors;

e.Graphics.FillEllipse(pthGrBrush, 0, 0, 140, 70);

------解决方案--------------------
使用PathGradientBrush
看一下Programming Microsoft Windows with CSharp第17章
------解决方案--------------------
路径渐变,在周鸣扬写的GDI+的程序设计中讲的比较清楚。