当前位置:网站首页>Draw some interesting figures with flutter's canvas
Draw some interesting figures with flutter's canvas
2022-07-01 01:30:00 【Ma Nong on the island】
brief introduction
In the last article, we introduced the use of Flutter Of Canvas An example of drawing basic graphics , Simple examples are no fun , In today's article, let's have some interesting , We will complete the following drawing :
- Discover the beauty of mathematical repetition : Use equilateral triangles to form a rainbow umbrella surface .
- Drawing a rainbow .
- Draw a five pointed star for scoring .
Through this article , We can know the basic principle of custom shape drawing , Then you can draw the figure you want to draw on this basis .
Equilateral triangles build the beauty of repetition
First, let's draw an equilateral triangle , In fact, in the last article, we also drew equilateral triangles , It's just that the three vertices are calculated manually , In this article, we encapsulate a general method for drawing equilateral triangles . Old rules , First define the input parameters of the method , As shown below :
canvas
:Canvas
canvascolor
: Draw colorsstartVertex
: The position of the first vertex of the triangle , Here, our other edges rotate relative to this pointlength
: Side lengthstartAngle
: The angle at which the first edge rotates relative to the horizontal direction , In this way, we can change the included angle to change the drawing position of the triangle .clockwise
: Draw clockwise , If it's clockwise , Then the offset angle drawn starts clockwise , Otherwise, counterclockwise .filled
: Whether to fill the drawing .
void drawEquilateralTriangle(
Canvas
边栏推荐
猜你喜欢
qt5-MVC:数据可视化的层次揭秘
基础知识之二——STA相关的基本定义
Zero of DC learning notes -- overview and basic process introduction
机器人编程的培训学科类原理
【网络丢包,网络延迟?这款神器帮你搞定所有!】
Locking relay ydb-100, 100V
未来的 Web3会带来什么?
图灵奖得主LeCun指明AI未来的出路在于自主学习,这家公司已踏上征途
Dls-42/6-4 dc110v double position relay
Installing mongodb database in Windows Environment
随机推荐
奇偶链表[链表操作的两种大方向]
【Qt5-基础篇_1】从0开始,德天老师和你一起学习——窗口简介
Xjy-220/43ac220v static signal relay
使用StrictMode-StrictMode原理(1)
"Open math input panel" in MathType editing in win11 is gray and cannot be edited
visual studio 2019 下载
迪赛智慧数——其他图表(平行坐标图):2021年应届专业就业情况
Call the classic architecture and build the model based on the classic
C# 自定义并动态切换光标
Pytorch programming knowledge (2)
Pre training / transfer learning of models
TypeError: Argument ‘angle‘ can not be treated as a double
Two position relay st2-2l/ac220v
Green, green the reed. dew and frost gleam.
fluttertoast
JS方法大全的一个小文档
【栈】921. Minimum Add to Make Parentheses Valid
微研所,微生物检验中常用的生化反应
Openmv and k210 of the f question of the 2021 video game call the openmv API for line patrol, which is completely open source.
js中把数字转换成汉字输出