21,886
社区成员
发帖
与我相关
我的任务
分享
<?php
header("Content-type:image/jpeg");
//从 JPEG 文件新建一图像
$image = ImageCreateFromJPEG("B_h.jpg");
$background = ImageCreateFromJPEG("Sunset.jpg");
//为图像分配颜色
$white = ImageColorAllocate($image,255,255,255);
$black = ImageColorAllocate($image,0,0,0);
//取得图像的宽度和高度
$imagex = ImageSx($image);
$imagey = ImageSy($image);
//$backgroundx = ImageSx($background);
//$backgroundy = ImageSy($background);
imagecopymerge($background,$image,0,0,0,0,$imagex,$imagey,50);
//输出jpeg图片
ImageJPEG($background);
//销毁图像
ImageDestroy($background);
?>