프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$verifyCodeFontFile | |||
$verifyCodeLength | |||
$waterMarkFontFile |
메소드 | 설명 | |
---|---|---|
addWaterMark ( string $groundImage, integer $waterPos, string $waterImage = "", string $waterText = "", integer $textFont = 15, string $textColor = "#FF0000", integer $minWidth = 100, integer $minHeight = 100, float $alpha = 0.9 ) : FALSE | 加给图片加水印 | |
addWaterMark2 ( string $groundImage, integer $waterPos, string $waterImage = "", string $waterText = "", integer $textFont = 5, string $textColor = "#FF0000", integer $minwidth = 100, integer $minheight = 100 ) : boolean | PHP图片水印 (水印支持图片或文字) 注意:Support GD 2.0,Support FreeType、GIF Read、GIF Create、JPG 、PNG $waterImage 和 $waterText 最好不要同时使用,选其中之一即可,优先使用 $waterImage。 当$waterImage有效时,参数$waterString、$stringFont、$stringColor均不生效。 加水印后的图片的文件名和 $groundImage 一样。 | |
cropImage ( string $image, array $params, integer $original_size, integer $crop_size ) : true/false | 裁切图片,制作头像 | |
cut ( $pic, $dst_pic, $width, $height = null, $qulitity = 100 ) : boolean | 裁切图片 | |
haveImagick ( ) | ||
readfile ( $pic ) : resource | false | 读取图像 | |
thumb_name ( $file_name, $insert = 'thumb' ) | ||
thumbnail ( $pic, $dst_pic, $max_width, null $max_height = null, integer $qulitity = 100, boolean $copy = true ) : boolean | 产生图片缩略图 | |
verifycode_chinese ( $font, $width = 180, $height = 60 ) : array | 生成汉字验证码 | |
verifycode_gd ( $img_width = 80, $img_height = 30 ) : array | 生成验证码使用GD | |
verifycode_imagick ( integer $img_width = 80, integer $img_height = 30, boolean $addRandomLines = true, boolean $swirl = true ) : array | 使用imagick扩展生成验证码图片 |
public static addWaterMark ( string $groundImage, integer $waterPos, string $waterImage = "", string $waterText = "", integer $textFont = 15, string $textColor = "#FF0000", integer $minWidth = 100, integer $minHeight = 100, float $alpha = 0.9 ) : FALSE | ||
$groundImage | string | 要加水印地址 |
$waterPos | integer | 水印位置 |
$waterImage | string | 水印图片地址 |
$waterText | string | 文本文字 |
$textFont | integer | 文字大小 |
$textColor | string | 文字颜色 |
$minWidth | integer | 小于此值不加水印 |
$minHeight | integer | 小于此值不加水印 |
$alpha | float | 透明度 |
리턴 | FALSE |
public static addWaterMark2 ( string $groundImage, integer $waterPos, string $waterImage = "", string $waterText = "", integer $textFont = 5, string $textColor = "#FF0000", integer $minwidth = 100, integer $minheight = 100 ) : boolean | ||
$groundImage | string | 背景图片,即需要加水印的图片,暂只支持GIF,JPG,PNG格式; |
$waterPos | integer | 水印位置,有10种状态,0为随机位置;1为顶端居左,2为顶端居中,3为顶端居右;4为中部居左,5为中部居中,6为中部居右;7为底端居左,8为底端居中,9为底端居右; |
$waterImage | string | 图片水印,即作为水印的图片,暂只支持GIF,JPG,PNG格式; |
$waterText | string | 文字水印,即把文字作为为水印,支持ASCII码,不支持中文; |
$textFont | integer | 文字大小 |
$textColor | string | 文字颜色,值为十六进制颜色值,默认为#FF0000(红色); |
$minwidth | integer | |
$minheight | integer | |
리턴 | boolean |
static public cropImage ( string $image, array $params, integer $original_size, integer $crop_size ) : true/false | ||
$image | string | 图片相对网站根目录的地址 |
$params | array | 参数,高度height=100,宽度width=116,精度qulitity=80,新图片的地址newfile,原图的真实宽度abs_width |
$original_size | integer | 原始的尺寸 |
$crop_size | integer | 裁切的参数,高度,宽度,四点坐标 |
리턴 | true/false |
static public readfile ( $pic ) : resource | false | ||
$pic | ||
리턴 | resource | false | | false |
static public verifycode_chinese ( $font, $width = 180, $height = 60 ) : array | ||
$font | ||
$width | ||
$height | ||
리턴 | array |
static public verifycode_gd ( $img_width = 80, $img_height = 30 ) : array | ||
$img_width | ||
$img_height | ||
리턴 | array |