$_im
$_im : resource
The underlaying image resource.
This class implements the Horde_Image API for the PHP GD extension.
__construct(array $params, array $context = array())
Constructor.
array | $params | The image object parameters. Values include:
|
array | $context | The object context - configuration, injected objects:
|
brush(integer $x, integer $y, string $color = 'black', string $shape = 'square')
Draws a shaped point at the specified (x,y) point.
Useful for scatter diagrams, debug points, etc. Draws squares, circles, diamonds, and triangles.
integer | $x | The x coordinate of the point to brush. |
integer | $y | The y coordinate of the point to brush. |
string | $color | The color to brush the point with. |
string | $shape | What brush to use? Defaults to a square. |
toFile( $data = null) : string
Saves image data to file.
If $data is false-ish, saves current image data after performing pending operations on the data. If $data contains raw image data, saves that data to file without regard for the current image data.
$data |
Path to temporary file.
getImageAtIndex(integer $index) : \Horde_Image_Base
Returns a specific image from the pages of images.
integer | $index | The index to return. |
The requested image
resize(integer $width, integer $height, boolean $ratio = true, boolean $keepProfile = false)
Resizes the current image.
integer | $width | The new width. |
integer | $height | The new height. |
boolean | $ratio | Maintain original aspect ratio. |
boolean | $keepProfile | Keep the image meta data (unused). |
yellowize(integer $intensityY = 50, integer $intensityB = 3)
Applies a yellow filter.
Adds a layer of yellow that can be transparent or solid. If $intensityY is 255 the image will be 0% transparent (solid).
integer | $intensityY | How strong should the yellow (red and green) be? (0-255) |
integer | $intensityB | How weak should the blue be? (>= 2, in the positive limit it will be make BLUE 0) |
text( $string, integer $x, integer $y, string $font = '', string $color = 'black', integer $direction, string $fontsize = 'small')
Draws a text string on the image in a specified location, with the specified style information.
$string | ||
integer | $x | The left x coordinate of the start of the text string. |
integer | $y | The top y coordinate of the start of the text string. |
string | $font | The font identifier you want to use for the text. |
string | $color | The color that you want the text displayed in. |
integer | $direction | An integer that specifies the orientation of the text. |
string | $fontsize | Size of the font (small, medium, large, giant) |
circle(integer $x, integer $y, integer $r, string $color, string $fill = null)
Draws a circle.
integer | $x | The x coordinate of the centre. |
integer | $y | The y coordinate of the centre. |
integer | $r | The radius of the circle. |
string | $color | The line color of the circle. |
string | $fill | The color to fill the circle. |
rectangle(integer $x, integer $y, integer $width, integer $height, string $color = 'black', string $fill = 'none')
Draws a rectangle.
integer | $x | The left x-coordinate of the rectangle. |
integer | $y | The top y-coordinate of the rectangle. |
integer | $width | The width of the rectangle. |
integer | $height | The height of the rectangle. |
string | $color | The line color of the rectangle. |
string | $fill | The color to fill the rectangle. |
roundedRectangle(integer $x, integer $y, integer $width, integer $height, integer $round, string $color = 'black', string $fill = 'none')
Draws a rounded rectangle.
integer | $x | The left x-coordinate of the rectangle. |
integer | $y | The top y-coordinate of the rectangle. |
integer | $width | The width of the rectangle. |
integer | $height | The height of the rectangle. |
integer | $round | The width of the corner rounding. |
string | $color | The line color of the rectangle. |
string | $fill | The color to fill the rounded rectangle with. |
dashedLine(integer $x0, integer $y0, integer $x1, integer $y1, string $color = 'black', string $width = 1, integer $dash_length = 2, integer $dash_space = 2)
Draws a dashed line.
integer | $x0 | The x co-ordinate of the start. |
integer | $y0 | The y co-ordinate of the start. |
integer | $x1 | The x co-ordinate of the end. |
integer | $y1 | The y co-ordinate of the end. |
string | $color | The line color. |
string | $width | The width of the line. |
integer | $dash_length | The length of a dash on the dashed line. |
integer | $dash_space | The length of a space in the dashed line. |
arc(integer $x, integer $y, integer $r, integer $start, integer $end, string $color = 'black', string $fill = null)
Draws an arc.
integer | $x | The x coordinate of the centre. |
integer | $y | The y coordinate of the centre. |
integer | $r | The radius of the arc. |
integer | $start | The start angle of the arc. |
integer | $end | The end angle of the arc. |
string | $color | The line color of the arc. |
string | $fill | The fill color of the arc (defaults to none). |
call(string $function, array $params = null) : mixed
Wraps a call to a function of the gd extension.
string | $function | The name of the function to wrap. |
array | $params | An array with all parameters for that function. |
The result of the function call.
_allocateColor(string $name, integer $alpha) : integer
Creates a color that can be accessed in this object.
When a color is set, the integer resource of it is returned.
string | $name | The name of the color. |
integer | $alpha | Alpha transparency (0 - 127). |
The resource of the color that can be passed to GD.