如何在php或jquery中动态自定义图像? [英] How to customize Images dynamically in php or jquery?

查看:85
本文介绍了如何在php或jquery中动态自定义图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找用PHP创建产品自定义工具的方法.该工具将允许用户针对预定义的Mobile Cover创建自己的自定义. 我已经有一个Mobile Cover图像,我希望允许用户在Mobile Cover图像上用背景色写下他的名字. 用户可以更改其名称的字体大小和样式.

I am looking to create a Product customisation tool in PHP. This tool will allow the user to create his own Customization to a predefined Mobile cover. I already have a Mobile cover image and I am looking to allow a user to write his name under a background colour on the Mobile cover image. User can change the font size and style for his name.

我不确定如何继续进行.我正在寻找动态创建放置在移动保护套上的图像,以使其看起来像是它的一部分.

I am not sure how to proceed ahead with it. I am looking to dynamically create image that is placed on the Mobile cover in such way that it looks its part.

我正在寻找方法,以及应该使用哪个php图像处理库.

I am looking for way on how to approach it and which php image handling libraries should I make use of .

我们将不胜感激.

Mohit Dhiman

Mohit Dhiman

推荐答案

在我看来,使用Ajax最好使用图像处理工具Imagick.但是,如果您不停地生成数据,那么这可能会非常缓慢,并且可能会占用大量CPU使用率.另一个解决方案是,您也许可以找到一些Flash产品编辑器,这些编辑器都已具备内置功能,唯一的缺点是移动设备的浏览器兼容性问题.

In my opinion you would be better using Ajax but with the image manipulation tool Imagick. However a downfall is this could potentially be very slow and also could use alot of CPU usage if your generating on the fly. Alother solution is you maybe able to find some flash product editors out there that all ready have this in built function, the only downside been the browser compatability issue with mobile devices.

我认为最好的方法是拥有一个模板图像和一个启用了Ajax的上传功能,该功能将图像输入到画布上(可能是html5),然后使用可拖动的html5或jquery画布并跟踪x和y轴.图片:

I think the best way would be to have a template image and an ajax enabled upload function that inputs that image onto a canvas (maybe html5) and then use a dragable html5 or jquery canvas and track the x and y axis on the image:

以下是一些有用的链接:

here are some maybe useful links:

http://jqueryui.com/draggable/-可拖动的jQuery

http://jqueryui.com/draggable/ - jquery dragable

http://www.w3schools.com/html/html5_draganddrop.asp -可拖动的画布

将上传的图像(使用Ajax)绘制到Canvas -绘制上传的图像画布

Drawing Uploaded Image(with Ajax) to Canvas - drawing uploaded image to canvas

Imagick php- http://php.net/manual/zh/class. imagick.php

Imagick php - http://php.net/manual/en/class.imagick.php

这篇关于如何在php或jquery中动态自定义图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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