Phalcon图像
注意
所有类都以前缀命名Phalcon
图像\适配器\AbstractAdapter
¶
-
命名空间
Phalcon\Image\Adapter
-
使用
Phalcon\Image\Enum
Phalcon\Image\Exception
-
继承
-
实现
AdapterInterface
所有图像适配器必须使用此类
属性¶
/**
* @var string
*/
protected $file;
/**
* Image height
*
* @var int
*/
protected $height;
/**
* @var mixed|null
*/
protected $image;
/**
* Image mime type
*
* @var string
*/
protected $mime;
/**
* @var string
*/
protected $realpath;
/**
* Image type
*
* Driver dependent
*
* @var int
*/
protected $type;
/**
* Image width
*
* @var int
*/
protected $width;
方法¶
设置图像的背景颜色 模糊图像public function crop( int $width, int $height, int $offsetX = null, int $offsetY = null ): AdapterInterface;
public function reflection( int $height, int $opacity = int, bool $fadeIn = bool ): AdapterInterface;
public function resize( int $width = null, int $height = null, int $master = static-constant-access ): AdapterInterface;
public function text( string $text, mixed $offsetX = bool, mixed $offsetY = bool, int $opacity = int, string $color = string, int $size = int, string $fontFile = null ): AdapterInterface;
public function watermark( AdapterInterface $watermark, int $offsetX = int, int $offsetY = int, int $opacity = int ): AdapterInterface;
图像\适配器\适配器接口
¶
-
命名空间
Phalcon\Image\Adapter
-
使用
Phalcon\Image\Enum
-
继承
-
实现
Phalcon\Image\Adapter类的接口
方法¶
向图像添加背景 模糊图像public function crop( int $width, int $height, int $offsetX = null, int $offsetY = null ): AdapterInterface;
public function reflection( int $height, int $opacity = int, bool $fadeIn = bool ): AdapterInterface;
public function resize( int $width = null, int $height = null, int $master = static-constant-access ): AdapterInterface;
public function text( string $text, int $offsetX = int, int $offsetY = int, int $opacity = int, string $color = string, int $size = int, string $fontFile = null ): AdapterInterface;
public function watermark( AdapterInterface $watermark, int $offsetX = int, int $offsetY = int, int $opacity = int ): AdapterInterface;
图像\适配器\Gd¶
-
命名空间
Phalcon\Image\Adapter
-
使用
Phalcon\Image\Enum
Phalcon\Image\Exception
-
继承
AbstractAdapter
-
实现
该文件是Phalcon框架的一部分。
(c) Phalcon团队team@phalcon.io
有关完整的版权和许可信息,请查看随此源代码分发的LICENSE.txt文件。
方法¶
析构函数protected function processText( string $text, mixed $offsetX, mixed $offsetY, int $opacity, int $red, int $green, int $blue, int $size, string $fontFile = null ): void;
protected function processWatermark( AdapterInterface $watermark, int $offsetX, int $offsetY, int $opacity ): void;
图像\适配器\Imagick¶
-
命名空间
Phalcon\Image\Adapter
-
使用
Imagick
ImagickDraw
ImagickDrawException
ImagickException
ImagickPixel
ImagickPixelException
Phalcon\Image\Enum
Phalcon\Image\Exception
-
继承
AbstractAdapter
-
实现
Phalcon\Image\Adapter\Imagick
图像操作支持。调整大小,旋转,裁剪等。
$image = new \Phalcon\Image\Adapter\Imagick("upload/test.jpg");
$image->resize(200, 200)->rotate(90)->crop(100, 100);
if ($image->save()) {
echo "success";
}
属性¶
方法¶
构造函数 销毁加载的图像以释放资源。public function liquidRescale( int $width, int $height, int $deltaX = int, int $rigidity = int ): AbstractAdapter;
protected function processText( string $text, mixed $offsetX, mixed $offsetY, int $opacity, int $red, int $green, int $blue, int $size, string $fontFile = null ): void;
protected function processWatermark( AdapterInterface $image, int $offsetX, int $offsetY, int $opacity ): void;
图像\Enum¶
-
命名空间
Phalcon\Image
-
使用
-
继承
-
实现
该文件是Phalcon框架的一部分。
(c) Phalcon团队team@phalcon.io
有关完整的版权和许可信息,请查看随此源代码分发的LICENSE.txt文件。
常量¶
const AUTO = 4;
const HEIGHT = 3;
const HORIZONTAL = 11;
const INVERSE = 5;
const NONE = 1;
const PRECISE = 6;
const TENSILE = 7;
const VERTICAL = 12;
const WIDTH = 2;
图像\Exception¶
-
命名空间
Phalcon\Image
-
使用
-
继承
\Exception
-
实现
在Phalcon\Image中抛出的异常将使用此类
图像\ImageFactory¶
-
命名空间
Phalcon\Image
-
使用
Phalcon\Factory\AbstractFactory
Phalcon\Image\Adapter\AdapterInterface
-
继承
AbstractFactory
-
实现
该文件是Phalcon框架的一部分。
(c) Phalcon团队team@phalcon.io
有关完整的版权和许可信息,请查看随此源代码分发的LICENSE.txt文件。