搜索
查看
编辑修改
首页
UNITY
NODEJS
PYTHON
AI
GIT
PHP
GO
CEF3
JAVA
HTML
CSS
搜索
寸_铁
这个屌丝很懒,什么也没留下!
关注作者
热门标签
jquery
HTML
CSS
PHP
ASP
PYTHON
GO
AI
C
C++
C#
PHOTOSHOP
UNITY
iOS
android
vue
xml
爬虫
SEO
LINUX
WINDOWS
JAVA
MFC
CEF3
CAD
NODEJS
GIT
Pyppeteer
article
热门文章
1
【华为OD机试真题 C语言】211、最优资源分配、芯片资源占用 | 机试真题+思路参考+代码解析_路灯照明问题华为od
2
Docker的安装和镜像管理并利用Docker容器实现nginx的负载均衡、动静分离
3
40岁失业了,如何调整自己心态?_失业了我该怎样调整自己
4
typora+picgo+git实现markdown文档图片在线插入_markdown(typora)中如何插入删除源文件后仍存在的图片?
5
python用户价值分析_python客户价值分析
6
[AIGC] 深入了解标准与异常重定向输出
7
一个简单的自然语言处理例子_自然语言算法举例
8
Upload-labs 1-21关 靶场通关笔记(含代码审计)_uploadlabs 最新通关攻略
9
如何一眼分辨是C还是C++_如何看是vc还是tc
10
论文笔记:Semantic Compositional Networks for Visual Caption_scn lstm rnn
当前位置:
article
> 正文
C#编程-130:Brush的五个继承类_c# brush
作者:寸_铁 | 2024-06-30 20:09:06
赞
踩
c# brush
Brush笔刷类,可以用颜色和图像填充图形,是
抽象类
,不可以实例化。
实例:
1、SolidBrushTest
using
System;
using
System.Drawing;
using
System.Windows.Forms;
namespace
SolidBrushTest
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Paint(
object
sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Brush brush =
new
SolidBrush(Color.Orange);
g.FillEllipse(brush, 10, 10, 200, 120);
g.Dispose();
}
}
}
2、
TextureBrushTest
using
System;
using
System.Drawing;
using
System.Windows.Forms;
using
System.IO;
namespace
TextureBrushTest
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Paint(
object
sender, PaintEventArgs e)
{
string
path =
@"D:\CS\GDIPlusTest\TextureBrushTest\img\微信图片_20170817213231.jpg"
;
Graphics g=e.Graphics;
if
(File.Exists(path))
{
Bitmap map =
new
Bitmap(path);
Brush brush =
new
TextureBrush(map);
g.FillEllipse(brush, 10, 10, 500, 500);
brush.Dispose();
}
else
{
MessageBox.Show(
"image is not exists"
);
}
g.Dispose();
}
}
}
3、LinearGradientBrushTest
using
System;
using
System.Drawing;
using
System.Windows.Forms;
using
System.Drawing.Drawing2D;
namespace
LinearGradientBrushTest
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Paint(
object
sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
LinearGradientBrush lgb =
new
LinearGradientBrush(
new
Point(10,10),
new
Point(290,90),Color.White,Color.FromArgb(255,0,0,0));
g.FillEllipse(lgb,10,10,280,120);
lgb.Dispose();
g.Dispose();
}
}
}
4、
PathGradientBrushTest
using
System.Drawing;
using
System.Windows.Forms;
using
System.Drawing.Drawing2D;
namespace
PathGradientBrushTest
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Paint(
object
sender, PaintEventArgs e)
{
//绘画路径
GraphicsPath gp =
new
GraphicsPath();
gp.AddEllipse(0,80,240,120);
//路径渐变画刷
PathGradientBrush pgb =
new
PathGradientBrush(gp);
pgb.CenterColor = Color.Orange;
Color[] colors = { Color.FromArgb(255,0,255,0)};
pgb.SurroundColors = colors;
//绘制椭圆
e.Graphics.FillEllipse(pgb,0,80,240,120);
pgb.Dispose();
}
}
}
5、
HatchBrushTest
using
System.Drawing;
using
System.Windows.Forms;
using
System.Drawing.Drawing2D;
namespace
HatchBrushTest
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Paint(
object
sender, PaintEventArgs e)
{
HatchBrush hatchBrush =
new
HatchBrush(HatchStyle.HorizontalBrick,Color.Red,Color.Yellow);
e.Graphics.FillEllipse(hatchBrush,0,80,240,120);
hatchBrush.Dispose();
}
}
}
声明:
本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:
https://www.wpsshop.cn/w/寸_铁/article/detail/773848
推荐阅读
article
世界
第一颗
FPGA
芯片级
拆解
:
详述工作原理...
关注、星标公众号,不错过精彩内容素材来源
:
EETOP作者
:
Ken Shirriff现场可编程门阵列(
FPGA
)可以实现任...
赞
踩
article
【云原生】-
Docker
快速搭建免费
的
WordPress
博客
平台
_免费以
docker
搭建
的
开源
网站
(...
WordPress
是使用PHP语言开发
的
博客
平台
,方便好用,详细
的
部署过程分享给大家
WordPress
是使用PHP语言开...
赞
踩
article
如何
搭建
代理
镜像
仓库_vps
搭建
docker
镜像
代理
...
将域名的证书放置到 cert 目录下,并把证书文件名称命名为该目录下的server名称;其中 server.crt 为 ...
赞
踩
article
【
Django
】调用
django
的
pbkdf2
_
sha256
加密算法
测试
_
django
使用sha25...
本文介绍了如何在基于
Django
的系统中使用PBKDF2
_
SHA256
加密算法
进行密码安全存储,包括settings.p...
赞
踩
article
如何利用
Idea
创建
一个
Servlet
项目(新手向)_
idea
如何
创建
servlet
文件...
Servlet
是tomcat的api,利用
Servlet
进行webapp开发很方便,本文将介绍如何通过
Idea
创建
一个S...
赞
踩
article
韩国
锂电池
工厂
火灾
:
行业
安全
警钟再次敲响...
这些传感器可以实时监测
锂电池
的温度、压力、气体浓度等参数,一旦发现异常情况,可以立即发出警报并采取相应措施,从而有效避免...
赞
踩
article
InceptionV3
详细代码,带
准确率
和
loss
分析,以及
ROC
曲线(
python
)_
python
...
from __future__ import absolute_importfrom __future__ import...
赞
踩
article
Dubbo
+
SpringBoot
+
Nacos
部署
服务
_
dubbo
nacos
启动了很多
服务
...
服务
发现示意图:不恰当的比喻Provider(购房者)、Container(手机号)、Registry(中介)、Cons...
赞
踩
article
python
计算机毕设【附源码】4s店
汽车
销售
管理
系统
(
django
+mysql+论文)_
汽车
销售
系...
本
系统
采用Python语言进行后端开发,基于Django框架构建,该框架以其“开箱即用”的特性和强大的功能集,为快速开发...
赞
踩
article
【
数据结构
C语言版本】
手把手
教你实现
二叉树
的
非
递归
前中后序
遍历
(附完整
代码
)_
数据结构
先中后
非
递归
...
目录写在前面
递归
遍历
非
递归
遍历
写在前面
递归
遍历
非
递归
遍历
_
数据结构
先中后
非
递归
法
二叉树
代码
数据结构
先中后
非
递归
法
二叉树
代...
赞
踩
article
网络安全
行业
大
模型
调研总结_
secllm
...
提高安全运营效率,在调查、分析、研判阶段可以作为安全运营人员的助手,提高安全运营效率;随着人工智能技术的发展,安全
行业
大...
赞
踩
article
从
入门
到
精通
,
超详细
的
程序员
Java
学习
路线指南
,
2024年最新
java
集合
面试
常用
的
问题有哪些_j...
现在正是金三银四
的
春招高潮
,
前阵子小编一直在搭建自己
的
网站
,
并整理了全套
的
**【一线互联网大厂
Java
核心
面试
题库+解析...
赞
踩
article
深度
学习
(DL,
Deep
Learning
)_
数据挖掘
dl的全称是什么...
深度
学习
(DL,
Deep
Learning
)是机器
学习
(ML, Machine
Learning
)领域中一个新的研究方...
赞
踩
article
DS:
堆
的
应用
—
—
两种
算法
和
TOP
-
K
问题...
本篇博客主要是讲解
堆
实现
的
过程中涉及到
的
两种
算法
—
—
向上调整
算法
和向下调整
算法
,以及一个很重要
的
应用场景
—
—
TOP
-
K
...
赞
踩
article
Qt
(三)
窗口
分割
、
停靠
、
堆叠_
qt
界面
分割
...
文章目录一
、
窗口
分割
QSplitter二
、
窗口
停靠
QDockWidget三
、
窗口
堆叠 QStackedWidget演...
赞
踩
article
探索
BitTherapy
——让
你
的
桌面
生动起来!...
探索
BitTherapy
——让
你
的
桌面
生动起来!项目地址:https://gitcode.com/curzel-it/b...
赞
踩
article
spring
security
如何对密码进行
加密
_
java
spring
security
加密
算法...
这是一份最全面、最详细、最高质量的
java
面试题,不建议你死记硬背,只要每天复习一遍,有个大概印象就行了。BCrypt...
赞
踩
article
docker
-
compose
:
未找到命令,
安装
docker
-
compose
...
1、
安装
扩展源sudo yum -y install epel-release2、
安装
python-pip模块sudo ...
赞
踩
article
K8sGPT
+
Ollama
:免费
的
Kubernetes
自动化
诊断方案...
周末检查博客草稿,发现了这篇。记得当时是与一起写
的
,算算过去了一年之久,这拖延症也算是病入膏肓了。原本想使用 K8sGP...
赞
踩
article
社交
媒体与
社会
网络
分析,深度解读
社交
网络
营销_
社会
网络
同群
效应
...
这种不那么针锋相对的
社交
方式,一方面可以缓解紧张和尴尬,在面对面的交往中,你说的每一句话、做的每一件事,不经意间流露的表...
赞
踩
相关标签
python
嵌入式
编程语言
人工智能
单片机
云原生
docker
开源
容器
运维
django
sqlite
数据库
intellij-idea
servlet
安全
loss
ROC
Inception
准确率
java
dubbo
spring boot
spring
课程设计