C#线性渐变画刷LinearGradientBrush用法实例
更新时间:2015年06月11日 15:09:29 作者:zhuzhao
这篇文章主要介绍了C#线性渐变画刷LinearGradientBrush用法,实例分析了线性渐变画刷LinearGradientBrush的相关使用技巧,需要的朋友可以参考下
本文实例讲述了C#线性渐变画刷LinearGradientBrush用法。分享给大家供大家参考。具体如下:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace WindowsApplication2 { public partial class Form8 : Form { public Form8() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { /*LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.White, Color.Red, LinearGradientMode.Horizontal); Graphics g = this.CreateGraphics(); g.FillRectangle(brush, 1, 1, 100, 100); g.DrawString("zhuzhao", this.Font, brush, 1, 1);*/ /*LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.White, Color.Red, LinearGradientMode.Horizontal); brush.SetBlendTriangularShape(0.5f); Graphics g = this.CreateGraphics(); g.FillRectangle(brush, 1, 1, 1000, 100); g.DrawString("zhuzhao", this.Font, brush, 1, 1);*/ LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.White, Color.Red, LinearGradientMode.Horizontal); brush.SetSigmaBellShape(0.5f); Graphics g = this.CreateGraphics(); g.FillRectangle(brush, 1, 1, 1000, 100); g.DrawString("zhuzhao", this.Font, brush, 1, 1); } } }
希望本文所述对大家的C#程序设计有所帮助。
相关文章
浅析C#中StringBuilder类的高效及与String的对比
StringBuilder类所创造出来的字符串对象在拼接操作等方面比普通的string类往往要高效很多,这是它们在内存划分方式上的不同所决定的,下面就来浅析C#中StringBuilder类的高效及与String的对比2016-05-05
最新评论