auth->id}.png"; //这是背景图片的url $bannerimg = MODULE_URL."public/assets/poster/{$type}.jpg"; //用户信息 //这是要插入到图片的文字 if ($bannerimg) { if (is_file($bannerimg)) { //创建画布 $bgImg = imagecreatefromstring(file_get_contents($bannerimg)); // imagecopyresampled($bgImg, $head_img1, 299, 870, 0, 0, 156, 156, imagesx($head_img1), imagesy($head_img1)); // $head_img1 = imagecreatefromstring(file_get_contents($qrodeimg)); //将$qrodeimg插入到$bannerimg里 // if($i==1){ // imagecopyresampled($logo, $head_img1, 525, 865, 0, 0, 170, 170, imagesx($head_img1), imagesy($head_img1)); // } // if($i==2){ // imagecopyresampled($logo, $head_img1, 292, 686, 0, 0, 170, 170, imagesx($head_img1), imagesy($head_img1)); // } // if($i==3){ // imagecopyresampled($bgImg, $head_img1, 299, 870, 0, 0, 156, 156, imagesx($head_img1), imagesy($head_img1)); // } //生成图片 imagepng($bgImg, ROOT_PATH."public/uploads/poster/poster_{$type}.png"); } return true;//返回结果图片url } else { return false; } } }