\Image

Summary

Methods
Properties
Constants
__construct()
thumb()
waterMark()
newexif()
No public properties found
No constants found
No protected methods found
$pathwater
$path
N/A
position()
getInfo()
getImg()
getNewSize()
createNewImage()
copyImage()
kidOfImage()
No private properties found
N/A

Properties

$pathwater

$pathwater : 

Type

$path

$path : 

Type

Methods

__construct()

__construct(string  $path = '') 

创建图像对象时传递图像的一个路径,默认值是框架的文件上传目录

Parameters

string $path

可以指定处理图片的路径

thumb()

thumb(string  $filename, integer  $width, integer  $height,   $newimgname) : mixed

对指定的图像进行缩放

Parameters

string $filename

是需要处理的图片名称路径

integer $width

缩放后的宽度

integer $height

缩放后的高度

$newimgname

Returns

mixed —

是缩放后的图片名称,失败返回false;

waterMark()

waterMark(string  $groundName, string  $waterName, integer  $waterPos, string  $qz = "wa_") : mixed

为图片添加水印

Parameters

string $groundName

背景图片,即需要加水印的图片,暂只支持GIF,JPG,PNG格式;

string $waterName

图片水印,即作为水印的图片,暂只支持GIF,JPG,PNG格式;

integer $waterPos

水印位置,有10种状态,0为随机位置; 1为顶端居左,2为顶端居中,3为顶端居右; 4为中部居左,5为中部居中,6为中部居右; 7为底端居左,8为底端居中,9为底端居右;

string $qz

加水印后的图片的文件名在原文件名前面加上这个前缀,。

Returns

mixed —

是生成水印后的图片名称,失败返回false;

newexif()

newexif(  $file) 

图片旋转

Parameters

$file

array file域信息

position()

position(  $groundInfo,   $waterInfo,   $waterPos) 

Parameters

$groundInfo
$waterInfo
$waterPos

getInfo()

getInfo(  $filename) 

获取图片的信息

Parameters

$filename

getImg()

getImg(  $filename,   $imgInfo) 

创建图像资源

Parameters

$filename
$imgInfo

getNewSize()

getNewSize(  $name,   $width,   $height,   $imgInfo) 

返回等比例缩放的图片宽度和高度,如果原图比缩放后的还小保持不变

Parameters

$name
$width
$height
$imgInfo

createNewImage()

createNewImage(  $newImg,   $newName,   $imgInfo) 

Parameters

$newImg
$newName
$imgInfo

copyImage()

copyImage(  $groundImg,   $waterImg,   $pos,   $waterInfo) 

Parameters

$groundImg
$waterImg
$pos
$waterInfo

kidOfImage()

kidOfImage(  $srcImg,   $size,   $imgInfo) 

Parameters

$srcImg
$size
$imgInfo