C#線性漸變畫刷LinearGradientBrush用法實例
更新時間:2015年06月11日 15:09:29 作者:zhuzhao
這篇文章主要介紹了C#線性漸變畫刷LinearGradientBrush用法,實例分析了線性漸變畫刷LinearGradientBrush的相關(guān)使用技巧,需要的朋友可以參考下
本文實例講述了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#程序設(shè)計有所幫助。
相關(guān)文章
淺析C#中StringBuilder類的高效及與String的對比
StringBuilder類所創(chuàng)造出來的字符串對象在拼接操作等方面比普通的string類往往要高效很多,這是它們在內(nèi)存劃分方式上的不同所決定的,下面就來淺析C#中StringBuilder類的高效及與String的對比2016-05-05Unity3D利用DoTween實現(xiàn)卡牌翻轉(zhuǎn)效果
這篇文章主要為大家詳細介紹了Unity3D利用DoTween實現(xiàn)卡牌翻轉(zhuǎn)效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-02-02