C#線性漸變畫(huà)刷LinearGradientBrush用法實(shí)例
更新時(shí)間:2015年06月11日 15:09:29 作者:zhuzhao
這篇文章主要介紹了C#線性漸變畫(huà)刷LinearGradientBrush用法,實(shí)例分析了線性漸變畫(huà)刷LinearGradientBrush的相關(guān)使用技巧,需要的朋友可以參考下
本文實(shí)例講述了C#線性漸變畫(huà)刷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)文章
WPF中使用WebView2控件的方法及常見(jiàn)問(wèn)題
WebView2為WPF網(wǎng)頁(yè)瀏覽工具,具有簡(jiǎn)單易用,頁(yè)面顯示清晰的優(yōu)點(diǎn),下面這篇文章主要給大家介紹了關(guān)于WPF中使用WebView2控件的方法及常見(jiàn)問(wèn)題,文中通過(guò)實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2023-02-02
C#?wpf?Bitmap轉(zhuǎn)換成WriteableBitmap的方法
本文主要介紹了C#?wpf?Bitmap轉(zhuǎn)換成WriteableBitmap的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2022-08-08
C#調(diào)用WebService實(shí)例與開(kāi)發(fā)教程(推薦)
下面小編就為大家分享一篇C#調(diào)用WebService實(shí)例與開(kāi)發(fā)教程,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨想過(guò)來(lái)看看吧2017-12-12
c#通過(guò)進(jìn)程調(diào)用cmd判斷登錄用戶權(quán)限代碼分享
最近自己開(kāi)發(fā)軟件需要讀取本地配置文件,因?yàn)榈卿浻脩舻臋?quán)限不夠會(huì)導(dǎo)致無(wú)法讀取文件進(jìn)而導(dǎo)致程序崩潰,查了一些解決方法,代碼分享如下2013-12-12
.NET實(shí)現(xiàn)定時(shí)發(fā)送郵件代碼(兩種方式)
經(jīng)常發(fā)郵件的朋友都知道,郵箱有個(gè)特殊功能,可以設(shè)定郵件發(fā)送時(shí)間,定時(shí)發(fā)送,這個(gè)功能是怎么實(shí)現(xiàn)的呢?接下來(lái),小編給大家分享.NET實(shí)現(xiàn)定時(shí)發(fā)送郵件的代碼,有需要的朋友可以參考下2015-08-08

