c#中的渐变颜色 [英] Gradient Color in c#

查看:737
本文介绍了c#中的渐变颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何用2种颜色制作渐变色



如下图所示: -

http://www.vanseodesign.com/blog/wp- content / uploads / 2012/11 / linear-gradient.png [ ^ ]

解决方案

简单。使用类 System.Drawing.Drawing2D.LinearGradientBrush

http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.lineargradientbrush%28v=vs。 110%29.aspx [ ^ ]。



在调用其中一种方法时使用此画笔 System.Drawing.Graphics.FillRectangle

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fillrectangle%28v=vs.110%29.aspx [ ^ ]。



-SA

how to make a gradient color out of 2 colors?

like in the picture below:-
http://www.vanseodesign.com/blog/wp-content/uploads/2012/11/linear-gradient.png[^]

解决方案

Easy. Use the class System.Drawing.Drawing2D.LinearGradientBrush:
http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.lineargradientbrush%28v=vs.110%29.aspx[^].

Use this brush in the call to one of the methods System.Drawing.Graphics.FillRectangle:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fillrectangle%28v=vs.110%29.aspx[^].

—SA


这篇关于c#中的渐变颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆