开发者

Allowing user to manipulate images rendered in browser - API recommendation?

开发者 https://www.devze.com 2023-03-03 14:28 出处:网络
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 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 origina开发者_运维问答l 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.


JavaScript.


The HTML5 Canvas might do the trick.


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


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").

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号