public
|
#
__construct( string $file, integer $width = null, integer $height = null, integer $type = null )
Construct the object.
Parameters
- $file
- The image file to load or null if not loading.
- $width
- The width of the image to create.
- $height
- The height of the image to create.
- $type
- One of IMAGETYPE_JPEG, IMAGETYPE_PNG or IMAGETYPE_GIF
Throws
|
public
resource
|
#
getImageResource( )
Get the image resource loading it if required.
Get the image resource loading it if required.
Returns
resource The image resource.
|
public
array
|
#
getDimensions( )
Get the dimensions of the image.
Get the dimensions of the image.
Returns
array The width and height of the image.
|
public
integer
|
#
getWidth( )
Get the width of the image.
Get the width of the image.
Returns
integer The width.
|
public
integer
|
#
getHeight( )
Get the height of the image.
Get the height of the image.
Returns
integer The height.
|
public
integer
|
#
getType( )
The image type.
Returns
integer One of IMAGETYPE_JPEG, IMAGETYPE_PNG or IMAGETYPE_GIF
|
public
flImage
|
#
resize( integer $w, integer $h, boolean $scaleUp = false )
Resize the image to fit the given constraints while maintaining the aspect ratio.
Resize the image to fit the given constraints while maintaining the aspect ratio.
Parameters
- $w
- The width constraint or 0 to if no constraint.
- $h
- The height constraint or 0 to if no constraint.
- $scaleUp
- If true then the image will be scaled up or down to best fit the box, if false only scaling down will occur.
Returns
|
public
flImage
|
#
resizeCrop( integer $w, integer $h )
Resize the image to fit the given size while maintaining the aspect ratio and cropping off excess.
Resize the image to fit the given size while maintaining the aspect ratio and cropping off excess.
Parameters
- $w
- The required width of the image.
- $h
- The required height of the image.
Returns
|
public
flImage
|
#
crop( integer $x, integer $y, integer $w, integer $h )
Crop the selected region of the image out and keep it.
Crop the selected region of the image out and keep it.
Parameters
- $x
- The top left of the region.
- $y
- The top left of the region.
- $w
- The width of the region.
- $h
- The height of the region.
Returns
|
public
flImage
|
#
rotate( float $angle, integer $r, integer $g, integer $b, integer $a = null )
Rotate the image.
Parameters
- $angle
- The angle in degrees.
- $r
- The red for the background fill, 0 - 255
- $g
- The green for the background fill, 0 - 255
- $b
- The blue for the background fill, 0 - 255
- $a
- The alpha for the background fill, 0 - 127 or null if not used.
Returns
|
public
flImage
|
#
rectangle( boolean $fill, integer $x1, integer $y1, integer $x2, integer $y2, integer $r, integer $g, integer $b, integer $a = null )
Draw a rectangle.
Parameters
- $fill
- True to fill the rectangle or false to outline.
- $x1
- Top left x coordinate.
- $y1
- Top left y coordinate.
- $x2
- Bottom right x coordinate.
- $y2
- Bottom right y coordinate.
- $r
- The red for the background fill, 0 - 255
- $g
- The green for the background fill, 0 - 255
- $b
- The blue for the background fill, 0 - 255
- $a
- The alpha for the background fill, 0 - 127 or null if not used.
Returns
|
public
flImage
|
#
copyResampled( flImage $srcImage, integer $dx, integer $dy, integer $dw, integer $dh, integer $sx, integer $sy, integer $sw, integer $sh )
Copy a region of the source image into this image.
Copy a region of the source image into this image.
Parameters
- $srcImage
- The source image.
- $dx
- Destination x coordinate.
- $dy
- Destination y coordinate.
- $dw
- Destination width.
- $dh
- Destination height.
- $sx
- Source x coordinate.
- $sy
- Source y coordinate.
- $sw
- Source width.
- $sh
- Source height.
Returns
|
public
flImage
|
#
applyFilter( flImageFilter $filter )
Apply a filter to this image.
Apply a filter to this image.
Parameters
- $filter
- The filter object.
Returns
|
public
boolean
|
#
save( string $fileName = null, integer $quality = 90 )
Save the image to disk.
Parameters
- $fileName
- The name to save the file under or null for the existing name.
- $quality
- For jpg the quality, default is 90.
Returns
boolean true if the image was saved; else false.
Throws
|
public
|
#
output( integer $format = null, integer $quality = 90 )
Output the image to the browser.
Output the image to the browser.
Parameters
- $format
- null to use the current format or one of IMAGETYPE_PNG, IMAGETYPE_JPEG or IMAGETYPE_GIF
- $quality
- For jpg the quality, default is 90.
Throws
|