定制 jinas/dhivatar 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jinas/dhivatar

Composer 安装命令:

composer require jinas/dhivatar

包简介

Dhivehi Avatars PHP port.

README 文档

README

StyleCI

PHP port of phoenixatom Dhivatar package

Installation

composer require jinas/dhivatar

Usage

use Jinas\Dhivatar\DhivatarFactory;

(string) DhivatarFactory::create()
    ->setText('ޖިނާސް')
    ->build()
  	->encode('data-url');

This will output a base64 encoded of the image

OUTPUT:

default

use Jinas\Dhivatar\DhivatarFactory;

DhivatarFactory::create()
            ->setText("ޖިނާސް", "#C93839")
            ->setFontSize(255)
            ->setBackground("#3083AD")
            ->build()
            ->save('file', 80, 'jpg');  // save the image in 80% quality and  jpg format defined by third parameter

OUTPUT:

default

You can chain setters to customize the generated image.

If you don't set a background image. It will automatically generate a random background color.

Available Methods

  • setBackground(string $background) : Set the background of the image
  • setSize(int $width, int $height) : Set the size of the image canvas
  • setText(string $text, string $color) : Set the text and text color
  • setFontSize(int $size) : Set the font size
  • build() : This method will return an instance of Intervention\Image\Image after building the image. Any methods available by Image Intervention you can call to render,ouput or save the image.

Project by Jinas.

Inspired by phoenixatom dhivehi-avatar

Looking for an API that does this?

Head over to Dhivatar API. A project by Baivaru

统计信息

  • 总下载量: 26
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固