定制 objement/imagick-canvas 二次开发

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

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

objement/imagick-canvas

Composer 安装命令:

composer require objement/imagick-canvas

包简介

Library to easily generate Imagick graphics containing pictures, texts and shapes.

README 文档

README

PHP-Library to easily generate Imagick graphics containing pictures, texts and shapes by writing object-oriented PHP code.

Installation

The library is available on Packagist and can therefore be installed using Composer.

composer require objement/imagick-canvas

Examples

Create a centered watermark image

$image = new OmElementImage($filepath);
$canvas = new OmCanvas(
	OmCanvas::RESOLUTION_DEFAULT_SCREEN, // for web (resolution is important when working with texts)
	OmCanvas::COLORSPACE_RGB, // for web RGB, use CMYK for print
	$image->getWidth(), $image->getHeight()
);
$canvas->addElement($image, OmElementPosition::create(OmUnit::UNIT_PIXELS, 0, 0));
$watermark = new OmElementImage(realpath('watermark.png'), $image->getWidth()->divide(5));
$canvas->addElement($watermark, OmElementPosition::create(OmUnit::UNIT_PIXELS,
	$image->getWidth()->divide(2)->subtract($watermark->getWidth()->divide(2)->getValue())->getValue(), // center it: (image width / 2) - (watermark width / 2)
	$image->getHeight()->divide(2)->subtract($watermark->getHeight()->divide(2)->getValue())->getValue()
));

$canvas->getImage('png')->writeImage($filepath);

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MPL-2.0
  • 更新时间: 2021-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固