当前位置:网站首页>Compréhension simple de SVG
Compréhension simple de SVG
2022-07-03 02:21:00 【Grand bateau, oncle.】
svg
canvasEtsvgLa différence
canvas:
- Canvas - Oui.H5Les nouvelles étiquettes,C'est une toile..UtilisationJavaScriptDessiner une image sur une page web.Canvas.Est rendu pixel par Pixel,Riche en couleurs,Distorsion d'échelle.
- Modifier le dessin Il faut redessiner toute la toile
svg:
- Graphiques vectoriels extensibles(Format d'image non déformé après l'échelle Scalable Vector Graphics)
- svgC'est parDOMFonctionnement pour afficher,svgChaque dessin est un noeud séparé,Pour faciliter la modification des styles.
svg
version:svg Numéro de version de la spécification suivie 1.0 1.1Deux versions
xmlns:DéfinitionsvgNomenclature.
x yIndique les coordonnées de départ widthEtheightIndique la largeur et la hauteur du rectangle Avant de définir la couleur de remplissage Noir par défaut fillDéfinir la couleur de remplissage
<svg version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect x="30" y="30" width="100" height="100" fill="pink" class="r"/>
</svg>
svgChemin
M:moveTo Passer à un point de coordonnées
L:lineTo:Tracer une ligne vers un point de coordonnées
Z:closeFermé
stork:Couleur de la ligne
stork-width:Largeur de la ligne
<path d="M75,20 L100,100,L400,150,Z" fill="pink" stroke="yellow" stroke-width="10"> </path>
// Les majuscules sont absolues Les minuscules sont relatives Par rapport aux coordonnées précédentes
<path d="M75,20 l50,0,L50,10 Z" fill="" stroke="green" stroke-width=""> </path>
Cercle
cxEtcy C'est défini comme le Centre d'un cercle x yCoordonnées rRayon représentatif
<circle cx="100" cy="50" r="40" fill="" stroke="green" stroke-width="10">
Les paramètres représentent respectivement les coordonnées de départ Rayon maximum et rayon minimum Angle de rotation Grand et petit arc d'angle (1,0) Dans le sens contraire des aiguilles d'une montre(1,0) Coordonnées de la fin x y
<path d="M120,120 A60 60 0 1 1 121 121 Z" fill="" stroke="pink" stroke-width="20"> </path>
svgGradient
id Est le nom unique du gradient x1 y1 x2 y2 Direction du gradient de réglage
<defs>
<linearGradient id="grad" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="yellow" stop-opacity=""/>
<stop offset="33%" stop-color="blue" stop-opacity=""/>
<stop offset="66%" stop-color="green" stop-opacity=""/>
<stop offset="100%" stop-color="pink" stop-opacity=""/>
</linearGradient>
</defs>
// fillDéfinir la couleur de remplissage id C'est le nom du gradient
<rect x="10" y="10" width="200" height="200" fill="url(#grad)" style=""/>
svgAnimation
svg L'animation n'est pas disponible pour certaines scènes ,Il suffit de comprendre.
Suivez - moi.css L'animation ressemble beaucoup à
attriName:Déformation
type: Sélectionnez comment l'animation fonctionne Voici la rotation
form:Par où commencer?
to:Où ça finit
dur:Temps d'exécution de l'animation
repeatCount:Nombre de répétitions d'animation
<g>
<text x="150" y="100" style="">Manger Dormez. </text>
<animateTransform attributeName="transform"
attributeType="XML"
type="rotate"
from="0"
to="100"
dur="250ms"
repeatCount="indefinite"/>
</g>
svgTexte
Définir un itinéraire path id Nom de l'itinéraire d'exécution comme texte Selonid Sélectionnez le style d'alignement du texte
<defs>
<path d="M0 50 l100 100 l100 -100 Z " id="p1"/>
<path d="M0 50 l100 100 l100 -100 Z " id="p2"/>
</defs>
<text x="" y="" style="">
<textPath xlink:href="#p1">
Tao Dahua Fat Lin. C'est un sacré Groupe de six
</textPath>
</text>
边栏推荐
- Comment communiquer avec Huawei Cloud IOT via le Protocole mqtt
- My creation anniversary
- [shutter] shutter debugging (debugging control related functions | breakpoint management | code operation control)
- 基于线程池的生产者消费者模型(含阻塞队列)
- Leetcode (540) -- a single element in an ordered array
- 人脸识别6- face_recognition_py-基于OpenCV使用Haar级联与dlib库进行人脸检测及实时跟踪
- Gbase 8C system table PG_ collation
- y54.第三章 Kubernetes从入门到精通 -- ingress(二七)
- Solution for processing overtime orders (Overtime unpaid)
- Machine learning process and method
猜你喜欢
微服务组件Sentinel (Hystrix)详细分析
Ni visa fails after LabVIEW installs the third-party visa software
MySQL learning 03
Restcloud ETL cross database data aggregation operation
stm32F407-------IIC通讯协议
easyExcel
MySQL学习03
Memory pool (understand the process of new developing space from the perspective of kernel)
UDP receive queue and multiple initialization test
Tongda OA V12 process center
随机推荐
PyTorch 卷积网络正则化 DropBlock
使用Go语言实现try{}catch{}finally
easyExcel
Iptables layer 4 forwarding
力扣(LeetCode)183. 从不订购的客户(2022.07.02)
[Yu Yue education] reference materials of chemical experiment safety knowledge of University of science and technology of China
Gbase 8C system table PG_ authid
SPI mechanism
5. File operation
Machine learning process and method
What are the key points often asked in the redis interview
GBase 8c系统表-pg_constraint
Cancellation of collaboration in kotlin, side effects of cancellation and overtime tasks
Stm32f407 ------- IIC communication protocol
UDP receive queue and multiple initialization test
My creation anniversary
[shutter] top navigation bar implementation (scaffold | defaulttabcontroller | tabbar | tab | tabbarview)
Current situation and future of Web3 in various countries
Y54. Chapter III kubernetes from introduction to mastery -- ingress (27)
【教程】chrome关闭跨域策略cors、samesite,跨域带上cookie