HTML5 Canvas vs SVG/VML?

Please tell me what do you think about HTML5 Canvas vs SVG/VML? Give me pros and cons within comparison.

Thank you!!!

Answers


HTML5 Canvas is simply a drawing surface for a bit map. You set up a draw (Say with a color and line thickness) , draw that thing, and then the Canvas has no knowledge of that thing: It doesn't know where it is or what it is, it's just pixels. If you want to draw rectangles and have them move around or be selectable then you have to code all of that from scratch, including the code to remember that you drew them.

On the other hand, every SVG/VML element you create is a real element in the DOM. By default this allows you to keep much better track of the elements you create and makes dealing with things like mouse events easier by default.

Canvas would be better for faster things and heavy bitmap manipulation (like animation), but will take more code if you want lots of interactivity.


Need Your Help

User login like facebook by email or userid and password in C# using sql data reader?

c# sql-server logging sqldatareader

I want to build login system in C# and using sql Data reader, like Facebook, user can login to its account by using Email or UserID and Password. I wrote this code but does not working what is my p...