C#从画刷创建画笔的方法
作者:zhuzhao 时间:2022-11-22 15:49:17
本文实例讲述了C#从画刷创建画笔的方法。分享给大家供大家参考。具体实现方法如下:
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 Form11 : Form
{
public Form11()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
LinearGradientBrush brush = new LinearGradientBrush(this.ClientRectangle, Color.Empty, Color.Empty, 100);
ColorBlend blend = new ColorBlend();
blend.Colors = new Color[] { Color.Red, Color.Green, Color.Blue };
blend.Positions = new float[] { 0, .5f, 1 };
brush.InterpolationColors = blend;
Pen pen5 = new Pen(brush);
Graphics g5 = this.CreateGraphics();
Point[] p = new Point[] { new Point(0, 0), new Point(100, 100), new Point(50, 100), new Point(200, 100) };
g5.DrawEllipse(pen5, 0, 0, 100, 100);
}
}
}
希望本文所述对大家的C#程序设计有所帮助。
标签:C#,画刷,画笔
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Java Collection集合iterator方法解析
2022-11-17 06:43:29
Idea配置Maven阿里云镜像加速的实现
2021-10-24 11:30:32
![](https://img.aspxhome.com/file/2023/2/60682_0s.png)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.Transformer异常
2022-07-03 11:12:34
Java Exchanger并发类使用方法
2023-08-19 20:20:41
Java序列化JSON丢失精度问题的解决方法(修复Long类型太长)
2022-10-15 00:01:34
springboot对压缩请求的处理方法
2022-02-11 14:00:59
Java遍历json字符串取值的实例
2023-09-02 17:03:17
JavaWeb详细讲述Cookie和Session的概念
2022-03-23 08:39:44
![](https://img.aspxhome.com/file/2023/2/61272_0s.png)
java使用静态关键字实现单例模式
2023-11-29 13:37:33
![](https://img.aspxhome.com/file/2023/3/60763_0s.png)
Java基础之finally语句与return语句详解
2021-11-27 19:21:22
java selenium 操作浏览器实例
2023-04-13 17:57:13
Java实现五子棋网络版
2022-05-06 04:11:29
![](https://img.aspxhome.com/file/2023/2/63382_0s.png)
java编写简易贪吃蛇游戏
2021-08-03 02:53:49
JVM教程之内存管理和垃圾回收(三)
2023-11-10 15:49:54
![](https://img.aspxhome.com/file/2023/2/59352_0s.jpg)
java开发微信公众号支付
2021-10-24 16:02:40
![](https://img.aspxhome.com/file/2023/9/69339_0s.png)
SpringMVC 如何使用注解完成登录拦截
2023-11-18 02:20:11
Java使用二分法进行查找和排序的示例
2023-03-16 10:16:37
一文带你学会Spring JDBC的使用
2023-11-29 17:05:34
![](https://img.aspxhome.com/file/2023/7/60377_0s.jpg)
Java 字符终端上获取输入三种的方式分享
2021-12-31 04:52:45
Java8通过Function获取字段名的步骤
2022-07-14 14:06:23