C#線性漸變畫刷LinearGradientBrush用法實(shí)例
更新時(shí)間:2015年06月11日 15:09:29 作者:zhuzhao
這篇文章主要介紹了C#線性漸變畫刷LinearGradientBrush用法,實(shí)例分析了線性漸變畫刷LinearGradientBrush的相關(guān)使用技巧,需要的朋友可以參考下
本文實(shí)例講述了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); } } }
希望本文所述對(duì)大家的C#程序設(shè)計(jì)有所幫助。
相關(guān)文章
C#實(shí)現(xiàn)將程序運(yùn)行信息寫入日志的方法
這篇文章主要介紹了C#實(shí)現(xiàn)將程序運(yùn)行信息寫入日志的方法,可實(shí)現(xiàn)將程序運(yùn)行信息寫入日志并存儲(chǔ)在Debug目錄下的"/Log/PRG"下的功能,涉及C#針對(duì)日志的相關(guān)寫入技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-08-08C#實(shí)現(xiàn)軟件開機(jī)自啟動(dòng)的示例代碼
這篇文章主要為大家詳細(xì)介紹了如何利用C#實(shí)現(xiàn)軟件開機(jī)自啟動(dòng),且不需要管理員權(quán)限,文中的示例代碼講解詳細(xì),需要的小伙伴可以參考一下2023-07-07淺析C#中StringBuilder類的高效及與String的對(duì)比
StringBuilder類所創(chuàng)造出來(lái)的字符串對(duì)象在拼接操作等方面比普通的string類往往要高效很多,這是它們?cè)趦?nèi)存劃分方式上的不同所決定的,下面就來(lái)淺析C#中StringBuilder類的高效及與String的對(duì)比2016-05-05C#對(duì)list列表進(jìn)行隨機(jī)排序的方法
這篇文章主要介紹了C#對(duì)list列表進(jìn)行隨機(jī)排序的方法,涉及C#操作list列表的技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-04-04Unity3D利用DoTween實(shí)現(xiàn)卡牌翻轉(zhuǎn)效果
這篇文章主要為大家詳細(xì)介紹了Unity3D利用DoTween實(shí)現(xiàn)卡牌翻轉(zhuǎn)效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2019-02-02