HTML5 The comparison between canvas and inline SVG in the new element!

Source: Internet
Author: User

The differences and comparisons between SVG and canvas are as follows:

SVG: Use XML to describe 2D graphics, and canvas to describe 2D graphics using JavaScript.

Canvas is rendered per pixel, and in the canvas, once the drawing is done, it will not continue to get the attention of the browser. If its position changes, the entire scene also needs to be redrawn, including any objects that might have been overwritten by the graphic.

SVG is based on XML, and each drawn graph is treated as an object. If the properties of the SVG object change, the browser can automatically reproduce the graphic.

Canvas            SVG

<canvas> tags define graphs, tables, and other images, but you must use scripts (usually JavaScript) to draw graphics. Use the XML format to define graphics that define vector-based graphics for the network, and that the image has no loss in its graphics quality when zoomed in or changed size.
Dependent resolution not dependent on resolution
Event handlers support event handlers are not supported
Weak text rendering is best for applications with large rendering areas (such as Google Maps)
Ability to save results in. png or. jpg format high image complexity slows rendering speed (any applications that overuse the DOM are unpleasant)
Suitable for image-intensive games where many of the objects are frequently redrawn and are not suitable for gaming applications

  

This article references the following websites in writing:

Http://www.runoob.com/html/html5-svg.html                                                    






HTML5 The comparison between canvas and inline SVG in the new element!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.