使用 JavaScript 生成服务器端图像

发布于 2024-11-25 03:34:37 字数 78 浏览 5 评论 0原文

是否有任何工具可以让您使用 JavaScript 语言在服务器端生成图像?我正在研究使用相同的 JS 代码在客户端和服务器端渲染图像的可能性。

Are there any tools that allow you to generate images on the server side using JavaScript langauge? I'm investigating the possibility of using the same JS code to render images on the client side and on the server side.

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

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

发布评论

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

评论(2

谜兔 2024-12-02 03:34:37

请参阅此 npm 包 - 它可以执行从验证码到在服务器端调整照片大小的任何操作

https://npmjs.org/package/ canvas

对于客户端...我不知道,但它对于服务器端非常有效。
唯一的缺点是安装相当棘手 - https://github.com/learnboost/node-canvas/wiki

See this npm package - it can do anything from capchas to photo resazing on server sidde

https://npmjs.org/package/canvas

For client side... i do not know, but it works super for serverside.
The only downside is quite tricky installation - https://github.com/learnboost/node-canvas/wiki

聽兲甴掵 2024-12-02 03:34:37

让这个问题变得棘手的是你需要一些可以在服务器端和客户端都工作的东西。

如果您愿意将自己限制在 SVG(这意味着您可以告别)旧版本的 MSIE,那么可以根据任何 DOM 进行构建。

What makes this tricky is that you need something that works both server side and client side.

If you are willing to limit yourself to SVG (which means you can kiss goodbye) to older versions of MSIE, then that can be constructed as per any DOM.

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