您现在的位置是:首页> 编程文章 个人博客模板
laravel 安装 使用 intervention/image
无痕小Q个人博客
2021-11-17 10:44:48【
主页】
1477人已围观
简介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:效果




阅读量! (1477)
点击排行
养活我啊,嗯,我觉得,能带我吃饭就好了。
网站公告
- 欢迎来到我的博客
1:欢迎来到我的博客
2:博客免费api接口现已上线
3:博客会定期更新文章
4:欢迎大家来捧场
站点信息
剑外忽传收蓟北,初闻涕泪满衣裳。 却看妻子愁何在,漫卷诗书喜欲狂。 白日放歌须纵酒,青春作伴好还乡。 即从巴峡穿巫峡,便下襄阳向洛阳。
- 建站时间:2019-8-30
- 网站程序:php,laravel-swoole框架
- 今日流量:602(10分钟统计一次)
- 本月流量:28316
- 浏览总量:454757
- 统计方式:中间件,redis消息队列,定时任务
申请链接友情链接
青山横北郭,白水绕东城。
此地一为别,孤蓬万里征。
浮云游子意,落日故人情。
挥手自兹去,萧萧班马鸣。