Property | Type | Description | |
---|---|---|---|
$gdResource | resource | The GD resource handle |
Method | Description | |
---|---|---|
__construct ( resource $gdResource ) | Create a new object to handle a GD image | |
__destruct ( ) | Destroy the GD resource to free memory | |
convertToPaletteImage ( ) : static | Convert a true color image to a palette image with 256 colors and preserve transparency | |
copyTo ( self $gdImage, integer $x, integer $y, integer $width, integer $height ) : static | Save the GD image to a file | |
countColors ( integer $max = null ) : integer | Count the number of colors in the image | |
fromDimensions ( integer $width, integer $height ) : static | Get the GD image object for the specified dimensions | |
fromFile ( contao\File $file ) : static | Get the GD image object from an image file | |
getResource ( ) : resource | Get the GD resource handle | |
isSemitransparent ( ) : boolean | Detect if the image contains semitransparent pixels | |
saveToFile ( string $path ) : static | Save the GD image to a file | |
setResource ( resource $gdResource ) : static | Set the GD resource handle |
public __construct ( resource $gdResource ) | ||
$gdResource | resource | The GD resource handle |
public convertToPaletteImage ( ) : static | ||
return | static |
public countColors ( integer $max = null ) : integer | ||
$max | integer | Stop parsing the image if more colors than $max were found |
return | integer | The number of image colors |
public static fromDimensions ( integer $width, integer $height ) : static | ||
$width | integer | The image width |
$height | integer | The image height |
return | static | The GD image object |
public static fromFile ( contao\File $file ) : static | ||
$file | contao\File | The file object |
return | static | The GD image object |
public getResource ( ) : resource | ||
return | resource | The GD resource handle |
public isSemitransparent ( ) : boolean | ||
return | boolean | True if the image contains semitransparent pixels |
public saveToFile ( string $path ) : static | ||
$path | string | The image path |
return | static |
public setResource ( resource $gdResource ) : static | ||
$gdResource | resource | The GD resource handle |
return | static |