作者 郭宇鹏
1 个管道 的构建 失败 耗费 0 秒

'12-31'

... ... @@ -134,11 +134,11 @@ class Treasured extends BaseApi
->logo(ROOT_PATH.'public/assets/img/bg.png',4,1.97) //生成logo二维码
->logo($this->auth->avatar)//生成logo二维码
->getPath();//获取二维码生成的地址
$code = new QRcode();
// $code = new QRcode();
$qr_code_d = $code->png($url.$treasured['id']) //生成二维码
->logo(ROOT_PATH.'public/assets/img/bg.png',4,1.97) //生成logo二维码
->logo($this->auth->avatar)//生成logo二维码
->background(600,1020,cdnurl($qr_code_bg['value'])) //给二维码加上背景
->background(550,950,cdnurl($qr_code_bg['value'])) //给二维码加上背景
->getPath();//获取二维码生成的地址
// $qr_code = $this->createQrCode($url.$treasured['id'],4,1.97);
// $qr_code = $this->createQrCode($url.$treasured['id'],4,1.97,cdnurl($qr_code_bg['value']));
... ...
... ... @@ -32,5 +32,5 @@ return [
'mail_smtp_pass' => 'password',
'mail_verify_type' => '2',
'mail_from' => '10000@qq.com',
'qr_code_bg' => '/uploads/20201231/b7e5d8935e6702eb5c66d28de31a56a1.png',
'qr_code_bg' => '/uploads/20201231/93347da98b4444cff5dc713bf2c9b00d.png',
];
... ...
... ... @@ -152,10 +152,11 @@ class QRcode
//获取覆盖图图片的宽高
list($src_w, $src_h) = getimagesize($src_path);
$a = getimagesize($dst_path);
$b = getimagesize($src_path);
//将覆盖图复制到目标图片上,最后个参数100是设置透明度(100是不透明),这里实现不透明效果
imagecopymerge($dst, $src, $x, $y, 0, 0, $src_w, $src_h, 90);
imagecopymerge($dst, $src,$a[0]-$b[0]-10, $a[1]-$b[1]-10, 0, 0, $src_w, $src_h, 90);
$this->outfile = $this->cache_dir.DS.time().'.png';
imagepng($dst, $this->outfile);//根据需要生成相应的图片
... ...