+ 1
What is the difference between svg and canvas
4 Respostas
+ 5
Both of them are use for drawing and animation. Canvas draw with pixels via JavaScript while SVG uses vector directly via HTML.
https://www.sololearn.com/learn/HTML/2202/?ref=app
+ 5
Bro please use the search bar before questioning and follow community guidelines
Thanks
https://www.sololearn.com/discuss/1483172/?ref=app
https://www.sololearn.com/discuss/1671866/?ref=app
https://www.sololearn.com/discuss/1710028/?ref=app
https://www.sololearn.com/discuss/1568556/?ref=app
https://www.sololearn.com/discuss/1480522/?ref=app
https://www.sololearn.com/discuss/1525691/?ref=app
https://www.sololearn.com/discuss/1708824/?ref=app
https://www.sololearn.com/discuss/1747185/?ref=app
https://www.sololearn.com/discuss/1698246/?ref=app
https://www.sololearn.com/discuss/1316935/?ref=app
+ 3
Canvas:
- objects are drawn programmatically
- drawing based on pixels
- animation is not built
- fast pixel-based drawing operations
- need to take into account the resolution
- no support for event handlers
- the ability to save the resulting image in .png or .jpg format
- well suited for games with complex graphics
Svg:
- elements are part of the DOM (Document Object Model) model
- drawing by using vectors
- built-in effects, such as animation
- based on more understandable standard XML syntax
- no need to take permission into account
- implemented support for event handlers
- not suitable for gaming applications
- best suited for applications with a large display area (for example, Google Maps)
+ 2
Thank you