WPF,总觉得渐变不是很理想 http://msdn.microsoft.com/zh-cn/library/ms754083(v=vs.110).aspx 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我看了。不过,上面那个渐变效果,我还是不知道怎么才能做得滴水不漏。上边的图片 确实不好弄,如果做的话 ,光调色,设置offset 都得一天估计。 先用AI画出渐变效果,然后用Design工具,加载ai文件,用Design另存为XAML ,不过这种复杂的效果生成的文件会非常的大,建议直接用底图 直接让UI帮忙P张渐变图作为背景吧 像这样一张用AI设计出矢量图(800x600),生成的XAML有15M那么大... WPF 线性渐变不大容易调整出楼主贴图的效果http://www.360doc.com/content/12/1024/14/7362094_243471690.shtml采用线性渐变或者径向渐变,多试试下面的参数调整,旋转或改变中心点位置,效果还是可以向要求靠拢的。上面第一个矩形是线性渐变调整的,第二个矩形是径向渐变调整的。楼主明显采用的是径向渐变调整的效果,4#说渐变类型搞错了,他说的应该是采用线性渐变 GDI之渐变画笔画渐变图protected void Page_Load(object sender, EventArgs e) { Bitmap bitmap = new Bitmap(400, 150); Graphics g = Graphics.FromImage(bitmap); g.Clear(Color.White); Rectangle myRectangle = new Rectangle(40, 20, 90, 70); // LinearGradientBrush类使用线性渐变封装Brush对象 LinearGradientBrush LGBrush = new LinearGradientBrush(myRectangle, Color.Red, Color.YellowGreen, LinearGradientMode.ForwardDiagonal); g.FillEllipse(LGBrush, myRectangle); Point centerPoint = new Point(250, 60); GraphicsPath path = new GraphicsPath(); int R = 20; path.AddEllipse(centerPoint.X - R, centerPoint.Y - R, 2 * R, 2 * R); path.AddEllipse(centerPoint.X - 2 * R, centerPoint.Y - 2 * R, 4 * R, 4 * R); path.AddEllipse(centerPoint.X - 3 * R, centerPoint.Y - 3 * R, 6 * R, 6 * R); PathGradientBrush brush = new PathGradientBrush(path);//PathGradientBrush类则通过路径渐变封装Brush对象 //指定路径中心点 brush.CenterPoint = centerPoint; //指定路径中心点的颜色 brush.CenterColor = Color.Gray; //Color类型的数组指定与路径上每个顶点对应的颜色 brush.SurroundColors = new Color[] { Color.Red, Color.Green, Color.Snow }; g.FillPath(brush, path); System.IO.MemoryStream ms = new System.IO.MemoryStream(); bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Gif); Response.ClearContent(); Response.ContentType = "image/Gif"; Response.BinaryWrite(ms.ToArray()); } 阁下说的纵向、横向,指的是什么呢,在Blend中,是不是指的拉那个渐变矩形框呢? 下面这个不是渐变,是渐变叠加。在 Microsoft.Expression.Media.Effects 有多种效果可以叠加在一起,或者使用 System.Windows.Media.Effects.PixelShader 加载一种自定义的特效(例如每一个游戏里都有几十种通用的特效)。 Blend的渐变工具,只是简单的渐变。专业的美工并不仅仅对图片渐变一下。你应该找一找在Blend上使用 Effect 的教程,包括各种团队自定义开发并分享出来的 Effect 组件。给一个图片用多种特效叠加在一起,可以做出专业的效果。 Blend的渐变工具,只是简单的渐变。专业的美工并不仅仅对图片渐变一下。Blend的渐变,说白了,就是适用于规则的渐变。不规则的,如果也要用Blend来做,就得分割成很多快,直至每一小块都是规则的。这还不如用美工画图来得快啊。 代码的组织问题 如何更改模版页里meta标记的内容? 如何制作考试管理系统 一个关于dataGrid 的问题,很急! 如何将Int装转化为Color System.IndexOutOfRangeException: 在位置 1 处没有任何行。 我快不行了,大家给我点希望吧~~~~ VS C# 关于ctrl+a 和ctrl+v 实在搞不定。 求解释。 Picturebox的Paint事件触发问题,谢谢! 如何使用Npoi为工作表标签设置颜色,2007格式的。 请问哪位弟兄知道地磅接收的数据如何解码的问题
上边的图片 确实不好弄,如果做的话 ,光调色,设置offset 都得一天估计。
http://www.360doc.com/content/12/1024/14/7362094_243471690.shtml采用线性渐变或者径向渐变,多试试下面的参数调整,旋转或改变中心点位置,效果还是可以向要求靠拢的。
上面第一个矩形是线性渐变调整的,第二个矩形是径向渐变调整的。楼主明显采用的是径向渐变调整的效果,4#说渐变类型搞错了,他说的应该是采用线性渐变
protected void Page_Load(object sender, EventArgs e)
{
Bitmap bitmap = new Bitmap(400, 150);
Graphics g = Graphics.FromImage(bitmap);
g.Clear(Color.White);
Rectangle myRectangle = new Rectangle(40, 20, 90, 70);
// LinearGradientBrush类使用线性渐变封装Brush对象
LinearGradientBrush LGBrush = new LinearGradientBrush(myRectangle, Color.Red, Color.YellowGreen, LinearGradientMode.ForwardDiagonal);
g.FillEllipse(LGBrush, myRectangle);
Point centerPoint = new Point(250, 60);
GraphicsPath path = new GraphicsPath();
int R = 20;
path.AddEllipse(centerPoint.X - R, centerPoint.Y - R, 2 * R, 2 * R);
path.AddEllipse(centerPoint.X - 2 * R, centerPoint.Y - 2 * R, 4 * R, 4 * R);
path.AddEllipse(centerPoint.X - 3 * R, centerPoint.Y - 3 * R, 6 * R, 6 * R);
PathGradientBrush brush = new PathGradientBrush(path);//PathGradientBrush类则通过路径渐变封装Brush对象
//指定路径中心点
brush.CenterPoint = centerPoint;
//指定路径中心点的颜色
brush.CenterColor = Color.Gray;
//Color类型的数组指定与路径上每个顶点对应的颜色
brush.SurroundColors = new Color[] { Color.Red, Color.Green, Color.Snow };
g.FillPath(brush, path);
System.IO.MemoryStream ms = new System.IO.MemoryStream();
bitmap.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
Response.ClearContent();
Response.ContentType = "image/Gif";
Response.BinaryWrite(ms.ToArray());
}
Blend的渐变,说白了,就是适用于规则的渐变。不规则的,如果也要用Blend来做,就得分割成很多快,直至每一小块都是规则的。这还不如用美工画图来得快啊。