时间:2021-07-01 10:21:17 帮助过:16人阅读
$dst = imagecreatefromstring(file_get_contents($dst_path)); $src = imagecreatefromstring(file_get_contents($src_path)); imagecopy($dst, $src, 100, 100, 0, 0, 100, 100);//完成合并
function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct){ $opacity=$pct; // getting the watermark width $w = imagesx($src_im); // getting the watermark height $h = imagesy($src_im); // creating a cut resource $cut = imagecreatetruecolor($src_w, $src_h); // copying that section of the background to the cut imagecopy($cut, $dst_im, 0, 0, $dst_x, $dst_y, $src_w, $src_h); // inverting the opacity $opacity = 100 - $opacity; // placing the watermark now imagecopy($cut, $src_im, 0, 0, $src_x, $src_y, $src_w, $src_h); imagecopymerge($dst_im, $cut, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $opacity); }
相关推荐:
php实现微信中的图片合并-九宫格图片
以上就是php多张图片合并方法分享的详细内容,更多请关注Gxl网其它相关文章!