C#线性渐变画刷LinearGradientBrush用法实例
本文实例讲述了C#线性渐变画刷LinearGradientBrush用法。分享给大家供大家参考。具体如下:
usingSystem;
usingSystem.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Text;
usingSystem.Windows.Forms;
usingSystem.Drawing.Drawing2D;
namespaceWindowsApplication2
{
publicpartialclassForm8:Form
{
publicForm8()
{
InitializeComponent();
}
privatevoidbutton1_Click(objectsender,EventArgse)
{
/*LinearGradientBrushbrush=newLinearGradientBrush(this.ClientRectangle,Color.White,Color.Red,LinearGradientMode.Horizontal);
Graphicsg=this.CreateGraphics();
g.FillRectangle(brush,1,1,100,100);
g.DrawString("zhuzhao",this.Font,brush,1,1);*/
/*LinearGradientBrushbrush=newLinearGradientBrush(this.ClientRectangle,Color.White,Color.Red,LinearGradientMode.Horizontal);
brush.SetBlendTriangularShape(0.5f);
Graphicsg=this.CreateGraphics();
g.FillRectangle(brush,1,1,1000,100);
g.DrawString("zhuzhao",this.Font,brush,1,1);*/
LinearGradientBrushbrush=newLinearGradientBrush(this.ClientRectangle,Color.White,Color.Red,LinearGradientMode.Horizontal);
brush.SetSigmaBellShape(0.5f);
Graphicsg=this.CreateGraphics();
g.FillRectangle(brush,1,1,1000,100);
g.DrawString("zhuzhao",this.Font,brush,1,1);
}
}
}
希望本文所述对大家的C#程序设计有所帮助。
热门推荐
7 年月日祝福语简短
10 参加婚礼祝福语大全简短
11 老师送的祝福语简短
12 幼儿祝福语大全简短卡片
13 老师对学校祝福语简短
14 农民朋友发财祝福语简短
15 好朋友夫妻祝福语简短
16 初六开工祝福语简短
17 女神节日简短祝福语大全
18 简短56岁生日祝福语