您现在的位置是:首页> 编程文章 个人博客模板
laravel 安装 使用 intervention/image
无痕小Q个人博客
2021-11-17 10:44:48【
主页】
1452人已围观
简介composer require intervention/image
1;安装
composer require intervention/image
2:生成 config/image.php 配置文件:
php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"
3:使用
文档http://image.intervention.io/api/text
4:demo
use Intervention\Image\ImageManagerStatic as Image;
// 绘制模版1 y图
$data_y = Image::make($img_y);
$data_y->resize($y_w, 1080, function($constraint) {
$constraint->aspectRatio();
$constraint->upsize();
});
$data_y->text($request->name, $y_w/2, 350+$y_h,function ($font) use ($fontPath) {
$font->file($fontPath);
$font->size(120);
$font->color('#fdf6e3');
$font->align('center');
$font->valign('top');
});
$data_y->text($request->title, $y_w/2, 510+$y_h,function ($font) use ($fontPath) {
$font->file($fontPath);
$font->size(33.6);
$font->color('#fdf6e3');
$font->align('center');
$font->valign('top');
});
$data_y->text('会议时间: '.$request->begin_at, $y_w/2, 648+$y_h,function ($font) use ($fontPath) {
$font->file($fontPath);
$font->size(28.18);
$font->color('#fdf6e3');
$font->align('center');
$font->valign('top');
});
$data_y->text('会议地点: '.$request->place, $y_w/2, 685+$y_h,function ($font) use ($fontPath) {
$font->file($fontPath);
$font->size(28.18);
$font->color('#fdf6e3');
$font->align('center');
$font->valign('top');
})
->save($path_y,80,'jpg');
5:效果




阅读量! (1452)
点击排行
编程中我们会遇到多少挫折?表放弃,沙漠尽头必是绿洲。
网站公告
- 欢迎来到我的博客
1:欢迎来到我的博客
2:博客免费api接口现已上线
3:博客会定期更新文章
4:欢迎大家来捧场
站点信息
秋日硕果累累,却是多事之秋,任凭残存记忆悠悠回荡在脑海,不原再去想那朦胧情感过后的伤感。
- 建站时间:2019-8-30
- 网站程序:php,laravel-swoole框架
- 今日流量:864(10分钟统计一次)
- 本月流量:16207
- 浏览总量:442648
- 统计方式:中间件,redis消息队列,定时任务
申请链接友情链接
人间四月芳菲尽,山寺桃花始盛开。 长恨春归无觅处,不知转入此中来。