Both canvas and SVG allow you to draw in the browser, but they have different fundamentals. Anshan treatment Vitiligo How much money www.pfk0412.com
Svg
SVG is a language that describes two-dimensional graphics in XML.
SVG is XML-based, meaning that every element within the SVG DOM is available. You can add a JS event handler for each element.
In SVG, each graphic is written as an object. If the properties of an SVG object change, the browser can automatically regenerate the graph.
Canvas
Canvas can draw 2D graphics on fly (using JS)
Canvas can be regenerated in pixels.
In the canvas, once the graphic is complete, it will be forgotten by the browser. If the graphic position is to change, the entire screen needs to be redrawn, including objects covered by the graphic. The best hospital for treating dermatosis in Anshan www.pfk0412.com
Comparison of Canvas and SVG
The following table shows the main differences between canvas and SVG:
Canvas SVG
Dependent resolution independent of resolution
Event handlers support event handlers are not supported
Weak text rendering is best for applications with large rendering area (Google Maps)
You can save the final image as a PNG or JPG complex image, and the redraw is slow (any use of DOM will be slower)
Graphics games that are best suited for frequent redrawing of many objects are not suitable for gaming applications
Comparison of drawing principles between canvas and SVG in HTML5