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




阅读量! (1623)
点击排行
十年生死两茫茫,不思量,自难忘。
网站公告
- 欢迎来到我的博客
1:欢迎来到我的博客
2:博客免费api接口现已上线
3:博客会定期更新文章
4:欢迎大家来捧场
站点信息
空碧无云露湿衣,众星光外涌清规。 东林莫碍渐高势,四海正看当路时。 还许分明吟皓魄,肯教幽暗取丹枝。 可怜关夜婵娟影,正对五候残酒卮。
- 建站时间:2019-8-30
- 网站程序:php,laravel-swoole框架
- 今日流量:173(10分钟统计一次)
- 本月流量:28506
- 浏览总量:554689
- 统计方式:中间件,redis消息队列,定时任务
申请链接友情链接
泉眼无声惜细流,树阴照水爱晴柔。 小荷才露尖尖角,早有蜻蜓立上头。