$dst_path = './zsxz/zyjn.jpg'; $zzj='http://www.ndxlpx.com/'.$zp['zp']; $dst = imagecreatefromstring(file_get_contents($dst_path)); $src_image_2 = imagecreatefromstring(file_get_contents($zzj)); $src_image_width_2 = imagesx($src_image_2); //宽 $src_imageheight_2 = imagesy($src_image_2); //高 imagecopymerge($dst, $src_image_2, 2200,270, 0, 0,307,440,100); $font = './zsxz/SIMSUN.TTC';//字体 $black = imagecolorallocate($dst, 00, 00, 00); imagefttext($dst, 30, 0, 2490, 820, $black, $font, $list['name']); imagefttext($dst, 30, 0, 2460, 970, $black, $font, '居民身份证'); imagefttext($dst, 30, 0, 2400, 1150, $black, $font, $list['sfz']); imagefttext($dst, 30, 0, 2450, 1350, $black, $font, $list['zy']); imagefttext($dst, 30, 0, 2520, 1550, $black, $font, $list['zyfx']); imagefttext($dst, 30, 0, 2540, 1720, $black, $font, $list['jb']); imagefttext($dst, 30, 0, 2400, 1900, $black, $font, $list['zsbh']); imagefttext($dst, 30, 0, 920, 1795, $black, $font, $list['fzrq']); imagefttext($dst, 30, 0,425, 2115, $black, $font, $list['bh']); list($dst_w,$dst_h,$dst_type) = getimagesize($dst_path); //以下代码在页面输出并且保存 $filename = 'zsbcwjj/'.$list['name'].$list['jb'].$list['zy'].'.png'; ImagePng($dst, $filename); imagedestroy($dst); //以下代码直接在页面输出 header("content-type:image/jpeg"); imagejpeg($dst);
已有 170 位网友参与,快来吐槽:
发表评论