C#线性渐变画刷LinearGradientBrush用法实例
作者:zhuzhao 时间:2022-01-21 05:29:43
本文实例讲述了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#程序设计有所帮助。
标签:C#,画刷,LinearGradientBrush
0
投稿
猜你喜欢
java定时任务Timer和TimerTask使用详解
2023-07-13 00:29:33
Java编程语言特性和优势
2021-11-14 06:54:27
详解spring boot集成ehcache 2.x 用于hibernate二级缓存
2023-06-25 05:49:44
Java中this,static,final,const用法详解
2022-01-23 17:21:41
java泛型基本知识和通用方法
2023-09-19 12:59:12
Spring Cloud 动态刷新配置信息教程详解
2023-12-02 04:48:16
C# BitArray(点矩阵)转换成int和string的方法实现
2023-06-18 07:33:44
SpringBoot工程下使用OpenFeign的坑及解决
2022-08-24 18:00:38
Java实现班级管理系统
2022-05-08 07:29:48
java Apache poi 对word doc文件进行读写操作
2023-09-23 02:13:15
Java面向接口编程之命令模式实例详解
2021-10-19 14:26:53
使Java的JButton文字隐藏功能的实现(不隐藏按钮的前提)
2022-06-01 23:54:33
Spring Cloud Ribbon的使用原理解析
2021-10-11 02:03:01
Go Java算法最大单词长度乘积示例详解
2022-09-27 18:16:19
c#获取gridview的值代码分享
2023-06-27 22:23:50
C# 中如何利用lambda实现委托事件的挂接
2022-02-06 03:18:00
Android 实现卡片堆叠钱包管理动画效果
2021-12-12 11:15:02
java 遍历Map的几种方法总结
2023-09-25 23:39:21
关于Tomcat出现The origin server did not find a current representation for the target resourc...的问题
2023-03-03 18:02:43
java 中sendredirect()和forward()方法的区别
2021-11-07 18:39:28