[英]how can I put image on image and resize and drag it
I want to implement customize mug design with PHP, by default there is glass image is there, then user can upload her/his image , the the image will put on the glass, user change resize and move it, like below picture 我想用PHP实现自定义杯子设计,默认情况下有玻璃图像,然后用户可以上传她/他的图像,该图像将放在玻璃上,用户更改大小并移动它,如下图所示
how can I implement it , any idea? 我如何实现它,有什么想法吗? any help about some jquery libraries ....
关于一些jQuery库的任何帮助...。
For image dragging & resizing, you can use the .draggable() & .resizable() functions in jQuery UI. 对于图像的拖动和调整大小,可以在jQuery UI中使用.draggable()和.resizable()函数。
This is fully customized and you will be able to reach your goal easily. 这是完全定制的,您将可以轻松实现目标。
For image merging, you can use the code from this subject : 对于图像合并,您可以使用以下主题的代码:
<?php
$dest = imagecreatefrompng('vinyl.png');
$src = imagecreatefromjpeg('cover2.jpg');
imagealphablending($dest, false);
imagesavealpha($dest, true);
imagecopymerge($dest, $src, 10, 9, 0, 0, 181, 180, 100); //have to play with these numbers for it to work for you, etc.
header('Content-Type: image/png');
imagepng($dest);
imagedestroy($dest);
imagedestroy($src);
?> ?>
And if you use PHP, also have a look to ImageMagick 如果您使用PHP,也可以看看ImageMagick
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.