PHP如何在同一张图片上动态P上二维码
$base_name = "http://xxx/Public/Web/New/images/bg1-4.jpg";
$e = "http://xxx/qrcode.php?data=http://xxx?rec=J0010125";
// Content type
header("Content-Type: image/jpeg");
// Load
$thumb = @imagecreatefromjpeg($base_name);
list($width, $height) = getimagesize($e);
$e_p = imagecreatefrompng($e);
// Resize
imagecopyresized($thumb, $e_p, 100, 100, 0, 0, 200, 200, $width, $height);
// Output
imagejpeg($thumb);
$e = "http://xxx/qrcode.php?data=http://xxx?rec=J0010125";
// Content type
header("Content-Type: image/jpeg");
// Load
$thumb = @imagecreatefromjpeg($base_name);
list($width, $height) = getimagesize($e);
$e_p = imagecreatefrompng($e);
// Resize
imagecopyresized($thumb, $e_p, 100, 100, 0, 0, 200, 200, $width, $height);
// Output
imagejpeg($thumb);
imagedestroy($thumb);
100 100为位置坐标
200 200为二维码缩放后的大小
需要注意的是文件扩展名不同 需调用不同方法
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇: mysql查询同一个字段的三个count值
- 下一篇:没有了