首页 > Web开发 > 详细

php多图合并

时间:2016-09-26 12:36:53      阅读:240      评论:0      收藏:0      [点我收藏+]

function mergerImg($imgs) {

list($max_width, $max_height) = getimagesize($imgs[‘dst‘]);
$dests = imagecreatetruecolor($max_width, $max_height);

$dst_im = imagecreatefrompng($imgs[‘dst‘]);

imagecopy($dests,$dst_im,0,0,0,0,$max_width,$max_height);
imagedestroy($dst_im);

$src_im = imagecreatefrompng($imgs[‘src‘]);
$src_info = getimagesize($imgs[‘src‘]);
imagecopy($dests,$src_im,0,$max_height/2,0,0,$src_info[0],$src_info[1]);
imagedestroy($src_im);

header("Content-type: image/jpeg");
imagejpeg($dests);
}

$imgs = array(
‘dst‘ => ‘http://www.wangshangyou.com/content/uploadfile/201312/b3241386050881.png‘,
‘src‘ => ‘http://www.wangshangyou.com/content/uploadfile/201312/72691386051117.png‘
);

mergerImg($imgs);

php多图合并

原文:http://www.cnblogs.com/yuesha/p/5908617.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!