当前位置:网站首页>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 .
边栏推荐
- Have a heart beating Valentine's day in Singapore
- Unity a* road finding force planning
- One command to run rancher
- Unity lens making
- Static keyword
- Unreal 4 learning notes - data storage using blueprints
- 力扣2049:统计最高分的节点数目
- The role of break
- Unity download and installation website
- 【Paper】2021_ Uniformity of heterogeneous hybrid multi-level intelligent systems using UGV and UAV
猜你喜欢

SSL update method

Lambda&Stream

力扣209. 长度最小的子数组
Sourcetree usage

Li Kou 2049: count the number of nodes with the highest score

Meet in Bangkok for a romantic trip on Valentine's Day

SSL universal domain name certificate

UE4 method of embedding web pages

MySQL查询小工具(一)json格式的字符串字段中,替换json数组中对象的某个属性值

Unity lens making
随机推荐
Unity3d lookat parameter description
Brew install NVM command not found solution
Unity lens making
Malignant bug: 1252 of unit MySQL export
Qos(Quality of Service)
Important knowledge points in unity3d
JS 数组的排序 sort方法详解
The role of break
Detailed explanation of the process of "flyingbird" small game (camera adjustment and following part)
Meet in Bangkok for a romantic trip on Valentine's Day
一条命令运行rancher
SSL update method
How to apply for SSL certificate from the manufacturer
Winter vacation parent-child tour, these new york attractions are not only fun but also knowledge
Unreal 4 learning notes - Animated Montage
Keywords implements and @override
Arsenal Stadium Tour - take you to the front and back of Arsenal Stadium
Output directory of log files after unity3d packaging
One interview question a day - the underlying implementation of synchronize and the lock upgrade process
National Museum of Singapore - give you spiritual and physical satisfaction