当前位置:网站首页>The difference between SVG and canvas
The difference between SVG and canvas
2022-06-30 04:56:00 【Front end students】
svg Definition
1. Scalable vector graphics
2. Is based on xml Make a drawing
3.svg In case of enlargement or change of size, the graphic quality will not be damaged .
4.svg Every one of them is drawn ⼀ The elements of each figure are unique ⽴ Of DOM node ,
canvas Definition
1.h5 New properties
2. be based on js Make a drawing
Difference between them
1、svg Each graph can be regarded as an object , If the object properties change , The browser automatically reproduces the drawing . Change the change part automatically according to the change .canvas If the drawing is finished , Will no longer get the attention of the browser . If the position of the graph changes , The browser needs to be redrawn .
2、canvas Depending on resolution ,svg Independent of resolution .
3、canvas Event handler is not supported ,svg Support .Canvas The image drawn All in Canvas Inside this canvas , yes Canvas Part of , Out-of-service js Get the drawn graphic elements .
SVG A graph of corresponds to an element , So we can deal with DOM The elements are the same , Easy to give SVG Add the corresponding mouse event to the graphic element , This is also SVG Compare with Canvas A very big advantage of is that it can make the user interaction of graphics very simple .
4、canvas For large render area programs ( Like Google Maps ),svg Suitable for image intensive games .
边栏推荐
- Unity Logitech steering wheel access
- Important knowledge points in unity3d
- 力扣27. 移除元素
- Force buckle 349 Intersection of two arrays
- 【Paper】2019_ Consensus Control of Multiple AUVs Recovery System Under Switching Topologies and Time D
- 力扣2049:统计最高分的节点数目
- Connect to the database and run node JS running database shows that the database is missing
- MySQL query gadget (I) replace a property value of the object in the JSON array in the JSON format string field
- Webots notes day 2
- What is multimodal interaction?
猜你喜欢

力扣59. 螺旋矩阵 II

【Paper】2017_ Distributed control for high-speed trains movements

Create transfer generation point

图的一些表示方式、邻居和度的介绍

Oculus quest2 development: (I) basic environment construction and guide package

HTC vive cosmos development - handle button event

How to apply for SSL certificate from the manufacturer

Geotrustov wildcard

力扣349. 两个数组的交集

PS1 Contemporary Art Center, Museum of modern art, New York
随机推荐
Implementation of one interview question one distributed lock every day
pycharm 数据库工具
力扣59. 螺旋矩阵 II
SSL update method
Bean creation process and lazy init delay loading mechanism
Unreal 4 unavigationsystemv1 compilation error
Recommended cultural landmarks of these tourist attractions in Bangkok
Efficiency test of adding and querying ArrayList and LinkedList
Geotrustov wildcard
003-JS-DOM-Attr-innerText
Oculus quest2 development: (I) basic environment construction and guide package
力扣292周赛题解
Method of applying for code signing certificate by enterprise
JPA composite primary key usage
力扣349. 两个数组的交集
Detailed explanation of the process of "flyingbird" small game (camera adjustment and following part)
Royal Albert Hall, a popular landmark in London
Collective system
Introduction to some representations, neighbors and degrees of Graphs
Steamvr causes abnormal scene camera