HumHub Documentation (unofficial)

Drawer
in package
implements DrawerInterface, InfoProvider

FinalYes

Drawer implementation using the Imagick PHP extension.

Table of Contents

Interfaces

DrawerInterface
Interface for the drawer.
InfoProvider
Interface implemented by classes that provide info about a graphics driver.

Properties

$imagick  : Imagick

Methods

__construct()  : mixed
arc()  : $this
Draws an arc on a starting at a given x, y coordinates under a given start and end angles.
chord()  : $this
Same as arc, but also connects end points with a straight line.
circle()  : $this
Draws and circle with center at the given x, y coordinates, and given radius.
dot()  : $this
Places a one pixel point at specific coordinates and fills it with specified color.
ellipse()  : $this
Draws and ellipse with center at the given x, y coordinates, and given width and height.
getDriverInfo()  : Info|null
Get the info about this driver.
line()  : $this
Draws a line from start(x, y) to end(x, y) coordinates.
pieSlice()  : $this
Same as arc, but connects end points and the center.
polygon()  : $this
Draws a polygon using array of x, y coordinates. Must contain at least three coordinates.
rectangle()  : $this
Draws a rectangle from left, top(x, y) to right, bottom(x, y) coordinates.
text()  : $this
Annotates image with specified text at a given position starting on the top left of the final text box.
getColor()  : string
Gets specifically formatted color string from ColorInterface instance.

Properties

$imagick

private Imagick $imagick

Methods

__construct()

public __construct(Imagick $imagick) : mixed
Parameters
$imagick : Imagick

getDriverInfo()

Get the info about this driver.

public static getDriverInfo([mixed $required = true ]) : Info|null
Parameters
$required : mixed = true

when the driver is not available: if FALSE the function returns NULL, if TRUE the driver throws a \Imagine\Exception\NotSupportedException

Tags
see
InfoProvider::getDriverInfo()
since
1.3.0
Return values
Info|null

polygon()

Draws a polygon using array of x, y coordinates. Must contain at least three coordinates.

public polygon(array<string|int, mixed> $coordinates, ColorInterface $color[, mixed $fill = false ][, mixed $thickness = 1 ]) : $this
Parameters
$coordinates : array<string|int, mixed>
$color : ColorInterface
$fill : mixed = false
$thickness : mixed = 1
Tags
see
DrawerInterface::polygon()
Return values
$this

text()

Annotates image with specified text at a given position starting on the top left of the final text box.

public text(mixed $string, AbstractFont $font, PointInterface $position[, mixed $angle = 0 ][, mixed $width = null ]) : $this
Parameters
$string : mixed
$font : AbstractFont
$position : PointInterface
$angle : mixed = 0
$width : mixed = null
Tags
see
DrawerInterface::text()
Return values
$this

getColor()

Gets specifically formatted color string from ColorInterface instance.

private getColor(ColorInterface $color) : string
Parameters
$color : ColorInterface
Return values
string

        
On this page

Search results