html5画布元素和svg

问题描述:

为什么我们需要html5 canvas元素,同样可以通过嵌入式svg实现?

Why do we need the html5 canvas element, when the same can be achieved through embedded svg?

SVG和canvas并非真正可互换的技术。 SVG是一种保留模式图形,其中所有内容都是从相当抽象的模型(SVG文档)中提取的。另一方面,Canvas是一种立即模式图形,没有模型,客户端(JavaScript)必须处理重绘,动画等。

SVG and canvas aren't really interchangeable technologies. SVG is a type of retained mode graphics where everything is drawn from a rather abstract model (the SVG document). Canvas on the other hand is a kind of immediate mode graphics, where there is no model and the client (JavaScript) must take care of redrawing, animations etc.