建议:画布或 SVG

发布于 2024-12-22 13:39:50 字数 290 浏览 3 评论 0原文

在我的 Web 应用程序中,我必须绘制示意性网络组件,例如路由器、交换机等。 我的问题现在如下。我应该使用 HTML5 canvas 还是 SVG 哪种技术?我已经阅读了这篇关于那。然而我还是不稳定。

我认为 SVG 能更好地满足我的要求,因为用户必须能够调整元素的大小。此外,还必须能够使图像具有动画效果。

感谢您的建议。

In my web application I have to draw schematic network components such as routers, switches and son on.
My question is now as follows. Which technology should I use HTML5 canvas or SVG? I already read this article about that. However I am still unsteady.

I think SVG would better cover with my requirements because the user must be able to resize the element. Also it must be possible to animate the images.

Thanks for your suggestions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

七秒鱼° 2024-12-29 13:39:50

我个人会推荐 SVG 因为以下原因:

  • 您可能不必显示大量对象 -->性能不是问题。
  • 与 canvas 相比,SVG 中的动画、转换和用户交互更容易实现

您应该阅读一些其他资源:

注意:如果这对您来说是个问题,您也可以考虑浏览器兼容性。

I personally would recommend SVG because of following reasons:

  • you probably won't have to display huge numbers of objects --> performance is not an issue.
  • animation, transformations and user interaction are easier to implement in SVG compared to canvas

There are some additional ressources yous should read:

Note: You might also consider browser compatibility if that's an issue for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文