当前位置: 首页 > news >正文

php生成海报

$image_ewm = QrCode::format('png') ->margin(1) ->size(600) // 放大生成 ->generate(route('wechat.bill.personal', ['refereeId' => $refereeId])); $ewmpath = "uploads/agentshare/" . $refereeId . ".png"; Storage::disk("public")->put($ewmpath, $image_ewm); $image_ewm = imagecreatefrompng(storage_path("app/public/" . $ewmpath)); $image_share_bg = Utility::imagefrompngandjpe( storage_path(str_replace('/storage/', 'app/public/', $bgimg)) ); // 直接 copy,不 merge imagecopy( $image_share_bg, $image_ewm, imagesx($image_share_bg) - 400, imagesy($image_share_bg) - 235, 0, 0, imagesx($image_ewm), imagesy($image_ewm) ); // 用 PNG 输出 imagepng( $image_share_bg, storage_path("app/public/uploads/agentshare/" . $user->id . $refereeId . ".png") ); $imgUrl = "/storage/uploads/agentshare/" . $user->id . $refereeId . ".png";

imagecopy不会缩放

$image_ewm = QrCode::format('png') ->margin(1) ->size(600) // 高清源图 ->generate(route('wechat.bill.personal', ['refereeId' => $refereeId])); $ewmpath = "uploads/agentshare/" . $refereeId . ".png"; Storage::disk("public")->put($ewmpath, $image_ewm); $image_ewm = imagecreatefrompng(storage_path("app/public/" . $ewmpath)); $image_share_bg = Utility::imagefrompngandjpe( storage_path(str_replace('/storage/', 'app/public/', $bgimg)) ); // 关键:resampled 缩放 imagecopyresampled( $image_share_bg, $image_ewm, imagesx($image_share_bg) - 400, imagesy($image_share_bg) - 235, 0, 0, 200, 200, imagesx($image_ewm), imagesy($image_ewm) ); // PNG 输出 imagepng( $image_share_bg, storage_path("app/public/uploads/agentshare/" . $user->id . $refereeId . ".png") );
http://www.jsqmd.com/news/285616/

相关文章:

  • VIZE SCADA-工业实时历史数据库-实时库
  • P14963 [LBA-OI R2 B] 何意味 题解
  • 从嵌入式系统到智能终端
  • 构建“不崩溃”的嵌入式系统:防御性编程
  • 《机器学习》第 7 章 - 神经网络与深度学习
  • 神奇的找实习经历
  • DeepX OCR:以 DeepX NPU 加速 PaddleOCR 推理,在 ARM 与 x86 平台交付可规模化的高性能 OCR 能力
  • 不花钱也可以招一个“清华实习生”帮你干技术活
  • 从零开始安装并配置开源AI编程神器OpenCode
  • 全志T113的触摸屏
  • 泰国海外仓如何精准履约?基于海外仓WMS的拣货防错解决方案
  • 2026年1月高效空气过滤器厂家推荐榜单:覆盖W型/板式/袋式/耐高温/无隔板等全品类,专业净化解决方案深度解析与选购指南
  • 1.22假期记录
  • uniapp 请求封装!Token 过期自动刷新+队列缓存!CV即用
  • 2026年1月深圳跨境电商财税服务厂家推荐榜:合规记账/税务筹划/风险规避/代理申报一站式解决方案深度解析
  • C#每日面试题-简述反射
  • 日程7
  • 【Redis典型应用——缓存详解】 - 指南
  • C#每日面试题-简述异常处理
  • 重庆明镜滩项目-11-脚本学习-260122DataPreV5MissAna2
  • James 个人介绍(用于企业数字化服务咨询)
  • 勾股定理简单学习
  • Spring Boot 三种方式登录系统:集成微信扫码、短信验证码、邮箱验证码
  • Oracle 19c入门学习教程,从入门到精通,Oracle 数据表对象 —— 语法知识点详解与案例实践(10)
  • Cadence推出人工智能语音助手Tensilica HiFi iQ DSP IP
  • 鸿蒙 HarmonyOS 6 | 系统能力 (04):构建专业级媒体应用 PhotoAccessHelper 与复杂媒体库管理
  • 基于python的智慧农场管理系统
  • 【鸿蒙原生开发会议随记 Pro】拒绝面条代码 基于 MVVM 的代码架构与状态管理选型
  • aiSim领衔!国内外自动驾驶仿真软件大全:热门推荐与选择指南
  • 芒格的“反向激励“分析在量子计算云服务定价中的应用