// 建立一幅 434X630 的图像
$im = imagecreatetruecolor(434,630); //设置透明背景图 如果用imagecreate 则图片二维码上的用户头像变灰
$textcolor = imagecolorallocate($im, 255, 0, 255);
$str="你好!"; //解决中文乱码所以用imagettftext 方法
$white = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $white); //填充白色
imagettftext($im,25,0,5,40,$bg,THINK_PATH.'Library/Think/Verify/ttfs/simhei.ttf',$str);
$QR = imagecreatefromstring(file_get_contents("helloweba.png"));
imagecopy($im,$QR,2, 50,0, 0,430,430);
// 输出图像
header("Content-type: image/png");
imagepng($im);
exit;
$im = imagecreatetruecolor(434,630); //设置透明背景图 如果用imagecreate 则图片二维码上的用户头像变灰
$textcolor = imagecolorallocate($im, 255, 0, 255);
$str="你好!"; //解决中文乱码所以用imagettftext 方法
$white = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $white); //填充白色
imagettftext($im,25,0,5,40,$bg,THINK_PATH.'Library/Think/Verify/ttfs/simhei.ttf',$str);
$QR = imagecreatefromstring(file_get_contents("helloweba.png"));
imagecopy($im,$QR,2, 50,0, 0,430,430);
// 输出图像
header("Content-type: image/png");
imagepng($im);
exit;