1 Star 0 Fork 2

Devbank / php_poster

forked from Atlaxy / php_poster 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

使用方法

use atlaxy\Poster;
#默认大小
$img = new Poster();
# 宽度500 高度1000 背景颜色 RGB:244,244,244
//$img = new Poster(500,1000,"244,244,244");
#设置字体
$img->setFont($_SERVER['DOCUMENT_ROOT']."/font/PF.TTF");
#绘制文字 超过海报宽度自动截取 文字内不要换行
$img->drawSingleLineText("我是chinese,你好啊,こんにちは、我是chinese,你好啊,こんにちは、",24,10,10);
#绘制图片
$img->drawImage("https://xxpt.vshop365.cn/storage/upload/6e/2ef680d1a60a95227eae226269d6dd.jpg",0,60,580,580);
$img->drawImage("https://xxpt.vshop365.cn/QrCode/user-coupon-16.png",300,650,230,230);
#绘制文字 设置最大右侧坐标 
$img->drawSingleLineText("我是chinese,你好啊,こんにちは、我是chinese,你好啊,こんにちは、",24,10,710,"0,0,0",300);
$img->savePng($_SERVER['DOCUMENT_ROOT']."/test.png");
  • 多行文本的 后续加入

avatar

MIT License Copyright (c) 2020 菜鸟Phper Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个快速生成海报的小功能。 展开 收起
PHP
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/devbank/php_poster.git
git@gitee.com:devbank/php_poster.git
devbank
php_poster
php_poster
master

搜索帮助