当前位置:网站首页>Drawing polygons with < polygon / > circular array in SVG tag
Drawing polygons with < polygon / > circular array in SVG tag
2022-04-23 03:07:00 【Zhang Xiaohuan~】
background : You need a circular array on the page ( coordinate ) Draw a rectangular , Realize the linkage of left and right rectangular borders , The effect can be referred to :null Through leading in-depth learning technology , For various forms , picture , file 、 certificates 、 A variety of general scenes such as face sheet 、 Multi lingual text for fast 、 Accurate detection and identification , Suitable for printing 、 Handwriting 、 tilt 、 Fold 、 General text recognition for scenes such as rotation 、 General character recognition . The current support 52 Languages include simplified Chinese 、 Traditional Chinese 、 Japanese 、 Korean 、 English 、 French 、 Portuguese 、 German 、 Italian 、 Dutch 、 Swedish language 、 Finnish language 、 Danish language 、 Norwegian 、 Hungarian 、 Vietnamese 、 South African 、 albanian 、 Basque 、 Catalan 、 Croatian 、 Czech 、 Estonian 、 Icelandic 、 irish 、 Latin 、 Latvian 、 Lithuanian 、 Malay Language 、 Polish language 、 romanian 、 Slovak 、 Slovenian 、 Swahili 、 Turkish language 、 Welsh 、 Maltese 、 Creole 、 Galician 、 Esperanto 、 Filipino 、 Indonesian 、 Azerbaijani 、 Spanish 、 Russian 、 Bulgarian 、 Macedonian 、 Ukrainian 、 Serbian 、 Belarusian 、 Greek 、 Armenian .https://www.textin.com/experience/text_recognize_3d1
1、 Store the coordinates of all loops in the array , Because we want to draw a rectangle , So there should be eight coordinate points in each array , In the form of several circular arrays :【 [x1 y1,x2 y2,x3 y3,x4 y4],[x1 y1,x2 y2,x3 y3,x4 y4],[x1 y1,x2 y2,x3 y3,x4 y4]......】;
2、 Code : Array ratioPositionArr That is, the above form ;
// Process the data returned from the back end : The coordinates in each array are scaled up and down , In a new array .
locationsPosition(newVal, oldVal) {
this.activeIfSvg = ''
this.ratioPositionArr = []
// console.log(77, newVal)
// this.ratioPositionArr=newVal
const itemArr = []
this.eryArr = []
// console.log('eryArr', this.ratioWidth)
newVal.forEach((item, index) => {
item.forEach(itemevery => {
this.eryArr.push(itemevery / this.ratioWidth)
})
itemArr.push(this.eryArr)
this.eryArr = []
})
// console.log('itemArr', itemArr)
this.ratioPositionArr = itemArr
// console.log('99',this.ratioPositionArr)
},
<div
id="svgbox"
class="svgbox"
style="border: 2px solid white"
ref="svgcanvas"
@mousedown="move"
>
<svg
class="svgelement"
style="width: 100%; height: 100%; border: 1px solid white"
ref="svgcanvas"
>
<polygon
v-for="(item, index) in ratioPositionArr"
:points="item"
:key="index"
:class="activeIfSvg === index ? 'activeIfSvg' : ''"
@click="getClickSvg(index)"
></polygon>
</svg>
</div>
3、 Final effect : The blue border is svg---polygon--points A polygon drawn according to the coordinates in the array !
版权声明
本文为[Zhang Xiaohuan~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230305531784.html
边栏推荐
- Niuke white moon race 5 [problem solving mathematics field]
- 准备一个月去参加ACM,是一种什么体验?
- Due to 3 ²+ four ²= five ², Therefore, we call '3,4,5' as the number of Pythagorean shares, and find the array of all Pythagorean shares within n (including n).
- The most easy to understand dependency injection and control inversion
- [ncnn] - the meaning of - 23300 in param
- Maui initial experience: Cool
- Realize QQ login with PHP
- 树莓派开发笔记(十二):入手研华ADVANTECH工控树莓派UNO-220套件(一):介绍和运行系统
- Summary of software test interview questions
- AC & A2C & A3C
猜你喜欢
微软是如何解决 PC 端程序多开问题的——内部实现
Recursion - outputs continuously increasing numbers
Golden nine silver ten interview season, you are welcome to take away the interview questions (with detailed answer analysis)
Detailed explanation of distributed things
Source Generator实战
ASP. Net 6 middleware series - Custom middleware classes
Introduction to ACM [TSP problem]
Tencent video price rise: earn more than 7.4 billion a year! Pay attention to me to receive Tencent VIP members, and the weekly card is as low as 7 yuan
C read / write binary file
Tencent video VIP member, weekly card special price of 9 yuan! Tencent official direct charging, members take effect immediately!
随机推荐
A set of C interview questions about memory alignment. Many people make mistakes!
Blazor University (11)组件 — 替换子组件的属性
Introduction and use of openfeign component
建立与遍历二叉树
The most detailed in the whole network, software testing measurement, how to optimize software testing cost and improve efficiency --- hot
Using positive and negative traversal to solve the problem of "the shortest distance of characters"
全网讲的最细,软件测试度量,怎样优化软件测试成本提高效率---火爆
Maui initial experience: Cool
Xamarin效果第二十二篇之录音效果
Use of slice grammar sugar in C #
Tips in MATLAB
Tencent video VIP member, weekly card special price of 9 yuan! Tencent official direct charging, members take effect immediately!
Notes sur le développement de la tarte aux framboises (XII): commencer à étudier la suite UNO - 220 de la tarte aux framboises de contrôle industriel advantech (i): Introduction et fonctionnement du s
使用两种方法来解决“最大回文数乘积”问题
REINFORCE
Summary of software test interview questions
C#中元组对象Tuple的使用
tf. keras. layers. Inputlayer function
数据挖掘系列(3)_Excel的数据挖掘插件_估计分析
腾讯视频VIP会员,周卡特价9元!腾讯官方直充,会员立即生效!