C#模式画刷HatchBrush用法实例
作者:zhuzhao 时间:2021-10-01 08:59:45
本文实例讲述了C#模式画刷HatchBrush用法。分享给大家供大家参考。具体如下:
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 Form7 : Form
{
public Form7()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
HatchBrush hat = new HatchBrush(HatchStyle.Divot, Color.DarkBlue, Color.White);
Graphics formGraphics = this.CreateGraphics();
formGraphics.FillRectangle(hat, new RectangleF(90.0F, 110.0F, 100, 100));
formGraphics.Dispose();
}
catch (System.IO.FileNotFoundException)
{
MessageBox.Show("There was an error opening the bitmap." + "Please check the path.");
}
}
private void Form7_Load(object sender, EventArgs e)
{
}
}
}
希望本文所述对大家的C#程序设计有所帮助。
标签:C#,画刷,HatchBrush
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
SpringBoot整合Mybatis自定义拦截器不起作用的处理方案
2023-03-19 04:35:14
![](https://img.aspxhome.com/file/2023/7/77937_0s.png)
浅谈SpringBoot资源初始化加载的几种方式
2022-03-09 08:14:34
![](https://img.aspxhome.com/file/2023/3/80253_0s.jpg)
10分钟带你理解Java中的弱引用
2023-02-09 10:35:55
只需两步实现Eclipse+Maven快速构建第一个Spring Boot项目
2023-08-03 23:47:43
![](https://img.aspxhome.com/file/2023/4/78354_0s.png)
Java 数组高频考点分析讲解
2021-09-01 13:14:36
![](https://img.aspxhome.com/file/2023/2/61152_0s.png)
Java聊天室之实现一个服务器与多个客户端通信
2021-06-03 11:34:45
![](https://img.aspxhome.com/file/2023/6/76636_0s.png)
详解Spring中的Environment外部化配置管理
2023-11-23 05:24:24
![](https://img.aspxhome.com/file/2023/9/59859_0s.png)
springboot返回图片流的实现示例
2023-11-23 17:30:08
详解SpringBoot中如何使用布隆过滤器
2023-11-10 17:43:06
Java为什么基本数据类型不需要进行创建对象?
2022-03-16 08:59:03
SpringMVC @RequestBody自动转json Http415错误的解决
2022-09-12 13:12:34
![](https://img.aspxhome.com/file/2023/0/63070_0s.jpg)
基于<aop:aspect>与<aop:advisor>的区别
2023-01-22 21:53:35
LeetCode程序员面试题之无重复字符的最长子串
2021-09-12 05:26:36
MyBatis源码浅析(一)开篇
2022-09-28 03:28:24
win10和win7下java开发环境配置教程
2022-05-01 05:34:22
![](https://img.aspxhome.com/file/2023/6/79866_0s.png)
java 字浮串提取方法汇集
2023-11-24 14:43:16
java获取中文拼音首字母工具类定义与用法实例
2023-07-14 08:23:55
详解springboot和vue前后端分离开发跨域登陆问题
2023-08-07 00:48:38
深入C# 内存管理以及优化的方法详解
2021-10-24 14:24:03
java实现邮件发送
2022-06-03 02:48:20
![](https://img.aspxhome.com/file/2023/2/68762_0s.jpg)