如何使用Node.js快速创建图像? [英] How to create an image on the fly with Node.js?

查看:154
本文介绍了如何使用Node.js快速创建图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用node.js和Express Web框架,我需要创建一个即时图像 .png .jpg (如验证码),然后我必须将该图像发送到浏览器。

i'm using node.js and Express web framework, I need to create an on the fly image .png or .jpg (like captcha), then i have to send that image to the browser.

最简单的方法是什么?
在图像中,我应该写字母/数字(最多5个)。

What is the simplest way to do that? In the image I should write letters/numbers (max 5).

我不知道使用哪个库来连接到在线服务,因为recaptcha模块。

P.S. I don't know what library to use that connects to an online service as the recaptcha module does.

推荐答案

也许你可以使用画布? Learnboost(TJ)的node.js中还有一个实现。我认为这个截屏很有趣。从演示中可以看出,它甚至在一些例子中呈现文字。另外在 npm注册表 / 节点模块部分我发现了更多有趣的链接

Maybe you could use canvas? There is also an implementation in node.js by Learnboost(TJ). I think this screencast is interesting to look at. As you see from presentation it even renders text in some examples. Also in the npm registry / node modules section I found a lot more interesting links

这篇关于如何使用Node.js快速创建图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆