ImageResize
in package
Table of Contents
Constants
- MIME_BMP = 3
- MIME_GIF = 1
- MIME_JPEG = 5
- MIME_PNG = 2
- MIME_XBM = 4
- SCALE_ASPECT_FILL = 3
- SCALE_ASPECT_FIT = 2
- SCALE_TO_FILL = 1
Properties
- $canvasH : int
- $canvasW : int
- $colorB : int
- $colorG : int
- $colorR : int
- $destH : int
- $destW : int
- $destX : int
- $destY : int
- $extension : string
- $mode : int
- $originalH : int
- $originalW : int
- $qualityJpeg : int
- $srcH : int
- $srcPath : string
- $srcW : int
- $srcX : int
- $srcY : int
- $engine : ImageEngine
Methods
- __construct() : mixed
- Constructor
- resize() : void
- リサイズ(幅・高さを指定)
- resizeToHeight() : void
- リサイズ(高さを指定・幅は自動計算)
- resizeToWidth() : void
- リサイズ(幅を指定・高さは自動計算)
- save() : void
- リサイズした画像を保存
- setBgColor() : void
- 背景色をセット
- setMode() : void
- リサイズモードをセット
- setQuality() : void
- 画像クオリティをセット
- resieToAspectFill() : void
- 指定されたサイズを埋めるようにトリミングしたサイズを取得
- resizeToAspectFit() : void
- アクスペクト比を維持するようにサイズを計算
Constants
MIME_BMP
public
int
MIME_BMP
= 3
MIME_GIF
public
int
MIME_GIF
= 1
MIME_JPEG
public
int
MIME_JPEG
= 5
MIME_PNG
public
int
MIME_PNG
= 2
MIME_XBM
public
int
MIME_XBM
= 4
SCALE_ASPECT_FILL
public
int
SCALE_ASPECT_FILL
= 3
SCALE_ASPECT_FIT
public
int
SCALE_ASPECT_FIT
= 2
SCALE_TO_FILL
public
int
SCALE_TO_FILL
= 1
Properties
$canvasH
protected
int
$canvasH
$canvasW
protected
int
$canvasW
$colorB
protected
int
$colorB
= 0
$colorG
protected
int
$colorG
= 0
$colorR
protected
int
$colorR
= 0
$destH
protected
int
$destH
$destW
protected
int
$destW
$destX
protected
int
$destX
= 0
$destY
protected
int
$destY
= 0
$extension
protected
string
$extension
$mode
protected
int
$mode
= self::SCALE_ASPECT_FILL
$originalH
protected
int
$originalH
$originalW
protected
int
$originalW
$qualityJpeg
protected
int
$qualityJpeg
= 95
$srcH
protected
int
$srcH
$srcPath
protected
string
$srcPath
$srcW
protected
int
$srcW
$srcX
protected
int
$srcX
= 0
$srcY
protected
int
$srcY
= 0
$engine
private
ImageEngine
$engine
Methods
__construct()
Constructor
public
__construct(string $path) : mixed
Parameters
- $path : string
Tags
resize()
リサイズ(幅・高さを指定)
public
resize(int $width, int $height) : void
Parameters
- $width : int
- $height : int
resizeToHeight()
リサイズ(高さを指定・幅は自動計算)
public
resizeToHeight(int $height) : void
Parameters
- $height : int
resizeToWidth()
リサイズ(幅を指定・高さは自動計算)
public
resizeToWidth(int $width) : void
Parameters
- $width : int
save()
リサイズした画像を保存
public
save(string $destPath) : void
Parameters
- $destPath : string
setBgColor()
背景色をセット
public
setBgColor(string $color) : void
Parameters
- $color : string
Tags
setMode()
リサイズモードをセット
public
setMode(int $mode) : void
Parameters
- $mode : int
setQuality()
画像クオリティをセット
public
setQuality(int $quality) : void
Parameters
- $quality : int
resieToAspectFill()
指定されたサイズを埋めるようにトリミングしたサイズを取得
private
resieToAspectFill() : void
resizeToAspectFit()
アクスペクト比を維持するようにサイズを計算
private
resizeToAspectFit() : void