当前位置:首页 > 建站学院 > 后端开发 >  php 图像拼接

php 图像拼接

后端开发   发布日期:2025年05月19日   浏览次数:164
 <?php 
     $bigphoto = "big.jpg";
     $footerphoto = "1.jpg";
     $biginfo = getimagesize($bigphoto);
     $footerinfo = getimagesize($footerphoto);
      
     $bigwidth = $biginfo[0];
     $bigheight = $biginfo[1];
      
     $footerwidth = $footerinfo[0];
     $footerheight= $footerinfo[1];
      
     $initwidth = max(array($bigwidth,$footerwidth));
     $initheight = max(array($bigheight,$footerheight))+ min(array($bigheight,$footerheight));
      
     header("Content-type: image/jpeg");     
     $im = imagecreatetruecolor($initwidth,$initheight); 
     imagecopyresized($im,imagecreatefromjpeg($bigphoto),0, 0, 0, 0,$bigwidth,$bigheight,$bigwidth,$bigheight);  
     imagecopyresized($im,imagecreatefromjpeg($footerphoto),0,$bigheight, 0, 0,$footerwidth,$footerheight,$footerwidth,$footerheight);
     imagejpeg($im);
 ?>

 

以上就是php 图像拼接的详细内容,更多关于php 图像拼接的资料请关注九品源码其它相关文章!