//查询用户信息$client=$this->where(array('id'=>$client_id))->find();$client_avatar=$client['头像'];$mine_code=$client['mine_code'];$have_code=is_file(SYS_ROOT_PATH."uploadfiles/qrcode/{$mine_code}.png");//if(!$have_code){//生成原始二维码图片$qrcode=sys_get_qrcode(SYS_ROOT."index.php/Webservice/V100/register/mine_code/{$mine_code}","uploadfiles/qrcode/{$mine_code}.png");//网络路径//原始二维码图绝对路径$codeRealPath=SYS_ROOT_PATH.“上传文件/二维码/{$mine_code}.png”;$logo=SYS_ROOT_PATH。"uploadfiles/qrcode-min.png";//准备好的模板图片$logo=imagecreatefromstring(file_get_contents($logo));$QR_width=imagesx($QR);//二维码图片宽度$QR_height=imagesy($QR);//二维码图片高度degree//图像合成imagecopyresampled($logo,$QR,320,1948,0,0,445,445,$QR_width,$QR_height);//保存到codeRealPath(path)imagepng($logo,$codeRealPath);$路径=$codeRealPath;如果($client['昵称']){$img=imagecreatefromstring(file_get_contents($path));//字体类型$font=SYS_ROOT_PATH."uploadfiles/font/wenrui.otf";//显示文本$text='我是'.$client['昵称'];//设置字体颜色$black=imagecolorallocate($img,255,255,255);imagettftext($img,26,0,470,1890,$black,$font,$text);imagepng($img,$path);}//合成头像if($client_avatar&&$client_avatar!=''){$member_avatar=imagecreatefromstring(file_get_contents($client_avatar));}else{$member_avatar=imagecreatefromstring(file_get_contents(SYS_ROOT_PATH."uploadfiles/default_avatar.png"));}$img=imagecreatefromstring(file_get_contents($path));imagecopyresampled($img,$member_avatar,500,2125,0,0,85,85,imagesx($member_avatar),imagesx($member_avatar));imagepng($img,$path);}}
