当前位置:网站首页>Shuttle uses custompaint to paint basic shapes
Shuttle uses custompaint to paint basic shapes
2022-06-28 02:39:00 【Ma Nong on the island】
Preface
Last one First time to know Flutter Drawing components for — CustomPaint We introduced CustomPaint The basic concept and use of , You can see CustomPaint Actually sum Front-end Canvas It's basically the same , Actually the front end Canvas Supported drawing methods CustomPaint All support , After all CustomPaint It's also based on Canvas Realized . In this article we will introduce CustomPaint Drawing basic graphics .
Draw a rectangle
Drawing a rectangle is relatively simple , The method is defined as follows :
void drawRect(Rect rect, Paint paint)
among rect To draw a rectangle ,paint That is, the brush configuration object . For example, we want to draw a width horizontally in the middle 200 x 120 The rectangular , You can use the following code :
canvas.drawColor(Color(0xFFF1F1F1), BlendMode.color);
var center = size / 2;
// Draw a rectangle
var paint = Paint()..color = Color(0xFF2080E5);
paint.strokeWidth = 2.0;
canvas.drawRect(
Rect.fromLTWH(center.width - 100, 60, 200, 120),
边栏推荐
- 【模糊神经网络】基于matlab的模糊神经网络仿真
- SQL injection bypass (3)
- Dynamic Host Configuration Protocol
- Jenkins - email notification plug-in
- 【历史上的今天】6 月 25 日:笔记本之父诞生;Windows 98 发布;通用产品代码首次商用
- 启牛开户安全吗?怎么线上开户?
- 【历史上的今天】5 月 29 日:共享软件先驱诞生;ChromeBox 推出;VoodooPC 创始人出生
- 【历史上的今天】6 月 23 日:图灵诞生日;互联网奠基人出生;Reddit 上线
- Opencv——霍夫变换以及遇到的一些问题
- 【历史上的今天】6 月 10 日:Apple II 问世;微软收购 GECAD;发明“软件工程”一词的科技先驱出生
猜你喜欢
随机推荐
Skills in schematic merging
Shardingsphere-proxy-5.0.0 establish MySQL read / write separation connection (6)
数据治理与数据标准
CVPR22收录论文|基于标签关系树的层级残差多粒度分类网络
How to handle computer security certificate errors
贪吃蛇 C语言
Jenkins - email notification plug-in
Solutions to st link USB communication error
SQL injection bypass (V)
flask基础:模板继承+静态文件配置
Flask基础:模板渲染+模板过滤使用+控制语句
SQL injection bypass (IV)
js实现时钟
Flutter 使用 CustomPaint 绘制基本图形
File transfer protocol --ftp
Complex and inefficient logistics? Three steps to solve problems in enterprise administration
How to realize red, green and yellow traffic lights in ros+gazebo?
批阅2022春季学期课程小论文提交情况
JS implementation clock
云原生(三十) | Kubernetes篇之应用商店-Helm









