FLEA_Helper_Image类参考

所有成员的列表。

公有成员

 FLEA_Helper_Image ($handle)
createFromFile ($filename, $fileext=null)
 resize ($width, $height)
 resampled ($width, $height)
 resizeCanvas ($width, $height, $pos= 'center', $bgcolor= '0xffffff')
 crop ($width, $height, $highQuality=true, $nocut=null)
 saveAsJpeg ($filename, $quality=80)
 saveAsPng ($filename)
 saveAsGif ($filename)
 destory ()
 extractColor ($color, $defualt= 'ffffff')

公有属性

 $_handle = null


详细描述

在文件Image.php32行定义。


成员函数文档

FLEA_Helper_Image::FLEA_Helper_Image ( handle  ) 

构造函数 开发者不能直接构造该类的实例,而是应该用 FLEA_Helper_Image::createFromFile() 静态方法创建一个 FLEA_Helper_Image 类的实例。

参数:
resource $handle
返回:
FLEA_Helper_Image

在文件Image.php50行定义。

参考自 createFromFile().

& FLEA_Helper_Image::createFromFile ( filename,
fileext = null 
)

从指定文件创建 Image 对象

对于上传的文件,由于其临时文件名中并没有包含扩展名。因此需要采用下面的方法创建 Image 对象:

$ext = pathinfo($_FILES['postfile']['name'], PATHINFO_EXTENSION); $image =& FLEA_Helper_Image::createFromFile($_FILES['postfile']['tmp_name'], $ext);

参数:
string $filename
string $fileext
返回:
FLEA_Helper_Image

在文件Image.php70行定义。

参考 __THROW()FLEA_Helper_Image()FLEA::loadClass().

FLEA_Helper_Image::resize ( width,
height 
)

快速缩放图像到指定大小(质量较差)

参数:
int $width
int $height

在文件Image.php99行定义。

FLEA_Helper_Image::resampled ( width,
height 
)

缩放图像到指定大小(质量较好,速度比 resize() 慢)

参数:
int $width
int $height

在文件Image.php115行定义。

FLEA_Helper_Image::resizeCanvas ( width,
height,
pos = 'center',
bgcolor = '0xffffff' 
)

调整图像大小,但不进行缩放操作

参数:
int $width
int $height
string $pos
string $bgcolor

在文件Image.php133行定义。

参考 extractColor().

FLEA_Helper_Image::crop ( width,
height,
highQuality = true,
nocut = null 
)

在保持图像长宽比的情况下将图像裁减到指定大小

参数:
int $width
int $height
boolean $highQuality
array $nocut

在文件Image.php196行定义。

参考 extractColor().

FLEA_Helper_Image::saveAsJpeg ( filename,
quality = 80 
)

保存为 JPEG 文件

参数:
string $filename
int $quality

在文件Image.php299行定义。

FLEA_Helper_Image::saveAsPng ( filename  ) 

保存为 PNG 文件

参数:
string $filename

在文件Image.php309行定义。

FLEA_Helper_Image::saveAsGif ( filename  ) 

保存为 GIF 文件

参数:
string $filename

在文件Image.php319行定义。

FLEA_Helper_Image::destory (  ) 

销毁图像

在文件Image.php327行定义。

FLEA_Helper_Image::extractColor ( color,
defualt = 'ffffff' 
)

将十六进制表示的颜色值转换为 rgb

参数:
string $color
string $defualt
返回:
array

在文件Image.php341行定义。

参考自 crop()resizeCanvas().


成员数据文档

FLEA_Helper_Image::$_handle = null

在文件Image.php39行定义。


该类的文档由以下文件生成:
Generated at Sat Feb 2 15:18:58 2008 for FleaPHP by  doxygen 1.5.3