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);
}
}
}
希望本文所述對大家的C#程序設(shè)計(jì)有所幫助。
相關(guān)文章
C#?wpf?Bitmap轉(zhuǎn)換成WriteableBitmap的方法
本文主要介紹了C#?wpf?Bitmap轉(zhuǎn)換成WriteableBitmap的方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2022-08-08
C#調(diào)用WebService實(shí)例與開發(fā)教程(推薦)
下面小編就為大家分享一篇C#調(diào)用WebService實(shí)例與開發(fā)教程,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨想過來看看吧2017-12-12
c#通過進(jìn)程調(diào)用cmd判斷登錄用戶權(quán)限代碼分享
最近自己開發(fā)軟件需要讀取本地配置文件,因?yàn)榈卿浻脩舻臋?quán)限不夠會導(dǎo)致無法讀取文件進(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)的呢?接下來,小編給大家分享.NET實(shí)現(xiàn)定時(shí)發(fā)送郵件的代碼,有需要的朋友可以參考下2015-08-08

