我有一个 php/mysql 驱动的数据库,其中存储特定页面的图像路径。这些图像全部托管在我的服务器本地。用户可以上传图片,然后将数据存储在mysql中。
我想让用户能够在渲染图像上绘图。
我需要JAVA来完成这个吗?
是否有其他 API 或语言可以帮助我实现目标?
基本上,我只是让用户在现有图像的“顶部”绘制。他们的绘图会以某种方式保存为 .png,然后我可以将其叠加在原始图像的顶部。但是,我希望用户能够选择颜色等。此外,我想限制一个人每 24 小时可以在每张照片上绘制的数量。
那么,你们觉得怎么样?闪光? JAVA? Php(如果我这么幸运的话)?我很想听听您对此的想法。
I have a php/mysql driven database, where image paths are stored for specific pages. The images are all hosted locally on my server. Users can upload images, and the data is then stored in mysql.
I would like to enable users to draw on top of rendered images.
Do I need JAVA to accomplish this?
Are there other APIs or languages that can aid me in my goal?
Basically, I would just let users draw "on top" of the existing image. Somehow their drawings would be saved to a .png, which I can then overlay on top of the original image. However, I'd like for the user to be able to choose the color, etc. Also, I would like to limit how much a person can draw on each photo per 24 hour period.
So, what do you guys think? Flash? JAVA? Php (if I should be so lucky)? I would love to hear your thoughts on this.
发布评论
评论(4)
JavaScript。
JavaScript.
HTML5 Canvas 或许可以解决这个问题。
The HTML5 Canvas might do the trick.
您不需要使用 Java。您可以使用 PHP Canvas 编程或客户端 javascript canvas 来完成此操作。
http://www.phpjabbers.com/put-watermark -on-images-using-php-php20.html
http://motyar.info/blog/2010/04/drawing-on-web-with-canvas-and-jquery.html
You need not to use Java. You can do that with PHP Canvas programming or in client side javascript canvas.
http://www.phpjabbers.com/put-watermark-on-images-using-php-php20.html
http://motyar.info/blog/2010/04/drawing-on-web-with-canvas-and-jquery.html
看看 SketchPad (http://mudcu.be/sketchpad/) - 它提供了您想要在 HTML5 / Canvas 中执行的所有操作的示例,但请注意,Canvas 方法的一个缺点是“保存”有点笨拙,并且看起来依赖于浏览器。您需要将图像转换为数据 uri,然后使用可用的浏览器命令手动保存它(例如右键单击和“另存为”)。
Look at SketchPad (http://mudcu.be/sketchpad/) - it has examples of everything you want to do in HTML5 / Canvas, but note that a downside of the Canvas approach is the "save" is a little clunky and seems to be browser dependent. You need to convert the image to a data uri, then save it using the available browser commands manually (like right click and "Save As").