FloorPlanner 应用程序的 SVG/Canvas 与 Flash
我计划创建一个平面图应用程序,允许用户使用鼠标绘制、调整大小、移动和旋转对象。我只是想知道使用 Flash 或 Javascript 是否会更好。如果使用 Javascript,我应该使用 canvas 还是 SVG?该应用程序将允许拖动选择来选择多个项目。
我正在努力下定决心,将性能和浏览器支持放在首位。如果 Javascript 是更好的选择,你们有什么建议和资源可以给我指出吗?
I'm planning to create a floor planner app that allows users to draw, resize, move and rotate objects with the mouse. I was just wondering if it would be better to use Flash or Javascript. If using Javascript, should I use canvas or SVG? The app will allow drag selection to select multiple items.
I'm trying to make up my mind with performance and browser support placed as top priority. Do you guys have any suggestions and resources that you could point me to if Javascript is the better option?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于这个应用程序,我绝对会选择 SVG。 (我是作为 Canvas 爱好者这样说的)
您不需要 Canvas 的性能,因为平面图不会动画化。如果您希望您的平面图能够跳舞、唱歌和玩俄罗斯方块,那么您会需要 Canvas。
所有 SVG 对象都已经是 DOM 对象,并且具有所有关联的事件处理程序,这将使您能够更快地创建应用程序,减少麻烦。使用 Canvas,您必须自己完成所有命中检测和跟踪。
所有主要浏览器(一直到 Internet Explorer 6!)都支持 SVG/VML,因此您将获得最大的兼容性。
I would absolutely go for SVG for this application. (and I say this as a lover of Canvas)
You won't need the performance of Canvas since the floorplan won't be animated. If you expect your floorplans to dance and sing and play Tetris then you'd want Canvas.
All SVG objects are already DOM objects and have all the associated event handlers, which will allow you to create your application much faster with less headaches. With Canvas you'd have to do all the hit-detection and keeping track on your own.
SVG/VML is supported in all major browsers (all the way down to Internet Explorer 6!) so you'll have maximum compatibility.