class GmagickDraw (View source)

Methods

annotate(float $x, float $y, string $text)

Draws text on the image.

arc(float $sx, float $sy, float $ex, float $ey, float $sd, float $ed)

Draws an arc falling within a specified bounding rectangle on the image.

bezier(array $coordinate_array)

Draws a bezier curve through a set of points on the image.

ellipse(float $ox, float $oy, float $rx, float $ry, float $start, float $end)

Draws an ellipse on the image.

getfillcolor()

Returns the fill color used for drawing filled objects.

float
getfillopacity()

Returns the opacity used when drawing.

string|false
getfont()

Returns a string specifying the font used when annotating with text.

float
getfontsize()

Returns the font pointsize used when annotating with text.

int
getfontstyle()

Returns the font style used when annotating with text.

int
getfontweight()

Returns the font weight used when annotating with text.

getstrokecolor()

Returns the color used for stroking object outlines.

float
getstrokeopacity()

Returns the opacity of stroked object outlines.

float
getstrokewidth()

Returns the width of the stroke used to draw object outlines.

int
gettextdecoration()

Returns the decoration applied when annotating with text.

string|false
gettextencoding()

Returns the code set used for text annotations.

line(float $sx, float $sy, float $ex, float $ey)

Draws a line on the image using the current stroke color, stroke opacity, and stroke width.

point(float $x, float $y)

Draws a point using the current stroke color and stroke thickness at the specified coordinates.

polygon(array $coordinates)

Draws a polygon using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.

polyline(array $coordinate_array)

Draws a polyline using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.

rectangle(float $x1, float $y1, float $x2, float $y2)

Draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings.

rotate(float $degrees)

Applies the specified rotation to the current coordinate space.

roundrectangle(float $x1, float $y1, float $x2, float $y2, float $rx, float $ry)

Draws a rounded rectangle given two coordinates, x and y corner radiuses and using the current stroke, stroke width, and fill settings.

scale(float $x, float $y)

Adjusts the scaling factor to apply in the horizontal and vertical directions to the current coordinate space.

setfillcolor(GmagickPixel|string $color)

Sets the fill color to be used for drawing filled objects.

setfillopacity(float $fill_opacity)

Sets the opacity to use when drawing using the fill color or fill texture. Setting it to 1.0 will make fill full opaque.

setfont(string $font)

Sets the fully-specified font to use when annotating with text.

setfontsize(float $pointsize)

Sets the font pointsize to use when annotating with text.

setfontstyle(int $style)

Sets the font style to use when annotating with text.

setfontweight(int $weight)

Sets the font weight to use when annotating with text.

setstrokecolor(GmagickPixel|string $color)

Sets the color used for stroking object outlines.

setstrokeopacity(float $stroke_opacity)

Specifies the opacity of stroked object outlines.

setstrokewidth(float $width)

Sets the width of the stroke used to draw object outlines.

settextdecoration(int $decoration)

Specifies a decoration to be applied when annotating with text.

settextencoding(string $encoding)

Specifies the code set to use for text annotations.

Details

GmagickDraw annotate(float $x, float $y, string $text)

Draws text on the image.

Parameters

float $x

x ordinate to left of text.

float $y

y ordinate to text baseline.

string $text

text to draw.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw arc(float $sx, float $sy, float $ex, float $ey, float $sd, float $ed)

Draws an arc falling within a specified bounding rectangle on the image.

Parameters

float $sx

starting x ordinate of bounding rectangle.

float $sy

starting y ordinate of bounding rectangle.

float $ex

ending x ordinate of bounding rectangle.

float $ey

ending y ordinate of bounding rectangle.

float $sd

starting degrees of rotation.

float $ed

ending degrees of rotation.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw bezier(array $coordinate_array)

Draws a bezier curve through a set of points on the image.

Parameters

array $coordinate_array

Coordinates array.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw ellipse(float $ox, float $oy, float $rx, float $ry, float $start, float $end)

Draws an ellipse on the image.

Parameters

float $ox

origin x ordinate.

float $oy

origin y ordinate.

float $rx

radius in x.

float $ry

radius in y.

float $start

starting rotation in degrees.

float $end

ending rotation in degrees.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickPixel getfillcolor()

Returns the fill color used for drawing filled objects.

Return Value

GmagickPixel

The GmagickPixel fill color used for drawing filled objects.

float getfillopacity()

Returns the opacity used when drawing.

Return Value

float

The opacity used when drawing using the fill color or fill texture. Fully opaque is 1.0.

string|false getfont()

Returns a string specifying the font used when annotating with text.

Return Value

string|false

A string on success and false if no font is set.

float getfontsize()

Returns the font pointsize used when annotating with text.

Return Value

float

The font size associated with the current GmagickDraw object.

int getfontstyle()

Returns the font style used when annotating with text.

Return Value

int

The font style constant (STYLE_) associated with the GmagickDraw object or 0 if no style is set.

int getfontweight()

Returns the font weight used when annotating with text.

Return Value

int

An int on success and 0 if no weight is set.

GmagickPixel getstrokecolor()

Returns the color used for stroking object outlines.

Return Value

GmagickPixel

Returns an GmagickPixel object which describes the color.

float getstrokeopacity()

Returns the opacity of stroked object outlines.

Return Value

float

Returns a float describing the opacity.

float getstrokewidth()

Returns the width of the stroke used to draw object outlines.

Return Value

float

Returns a float describing the stroke width.

int gettextdecoration()

Returns the decoration applied when annotating with text.

Return Value

int

Returns one of the DECORATION_ constants and 0 if no decoration is set.

string|false gettextencoding()

Returns the code set used for text annotations.

Return Value

string|false

Returns a string specifying the code set or false if text encoding is not set.

GmagickDraw line(float $sx, float $sy, float $ex, float $ey)

Draws a line on the image using the current stroke color, stroke opacity, and stroke width.

Parameters

float $sx

starting x ordinate.

float $sy

starting y ordinate.

float $ex

ending x ordinate.

float $ey

ending y ordinate.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw point(float $x, float $y)

Draws a point using the current stroke color and stroke thickness at the specified coordinates.

Parameters

float $x

target x coordinate.

float $y

target y coordinate.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw polygon(array $coordinates)

Draws a polygon using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.

Parameters

array $coordinates

The array of coordinates.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw polyline(array $coordinate_array)

Draws a polyline using the current stroke, stroke width, and fill color or texture, using the specified array of coordinates.

Parameters

array $coordinate_array

The array of coordinates.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw rectangle(float $x1, float $y1, float $x2, float $y2)

Draws a rectangle given two coordinates and using the current stroke, stroke width, and fill settings.

Parameters

float $x1

x ordinate of first coordinate.

float $y1

y ordinate of first coordinate.

float $x2

x ordinate of second coordinate.

float $y2

y ordinate of second coordinate.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw rotate(float $degrees)

Applies the specified rotation to the current coordinate space.

Parameters

float $degrees

degrees of rotation.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw roundrectangle(float $x1, float $y1, float $x2, float $y2, float $rx, float $ry)

Draws a rounded rectangle given two coordinates, x and y corner radiuses and using the current stroke, stroke width, and fill settings.

Parameters

float $x1

x ordinate of first coordinate.

float $y1

y ordinate of first coordinate.

float $x2

x ordinate of second coordinate.

float $y2

y ordinate of second coordinate.

float $rx

radius of corner in horizontal direction.

float $ry

radius of corner in vertical direction.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw scale(float $x, float $y)

Adjusts the scaling factor to apply in the horizontal and vertical directions to the current coordinate space.

Parameters

float $x

horizontal scale factor.

float $y

vertical scale factor.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setfillcolor(GmagickPixel|string $color)

Sets the fill color to be used for drawing filled objects.

Parameters

GmagickPixel|string $color

GmagickPixel indicating color to use for filling.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setfillopacity(float $fill_opacity)

Sets the opacity to use when drawing using the fill color or fill texture. Setting it to 1.0 will make fill full opaque.

Parameters

float $fill_opacity

The fill opacity.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setfont(string $font)

Sets the fully-specified font to use when annotating with text.

Parameters

string $font

The font name.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setfontsize(float $pointsize)

Sets the font pointsize to use when annotating with text.

Parameters

float $pointsize

The text pointsize.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setfontstyle(int $style)

Sets the font style to use when annotating with text.

The AnyStyle enumeration acts as a wild-card "don't care" option.

Parameters

int $style

The font style (NormalStyle, ItalicStyle, ObliqueStyle, AnyStyle).

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setfontweight(int $weight)

Sets the font weight to use when annotating with text.

Parameters

int $weight

The font weight (valid range 100-900).

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setstrokecolor(GmagickPixel|string $color)

Sets the color used for stroking object outlines.

Parameters

GmagickPixel|string $color

GmagickPixel representing the color for the stroke.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setstrokeopacity(float $stroke_opacity)

Specifies the opacity of stroked object outlines.

Parameters

float $stroke_opacity

Stroke opacity. The value 1.0 is opaque.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw setstrokewidth(float $width)

Sets the width of the stroke used to draw object outlines.

Parameters

float $width

The stroke width.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw settextdecoration(int $decoration)

Specifies a decoration to be applied when annotating with text.

Parameters

int $decoration

The text decoration. One of NoDecoration, UnderlineDecoration, OverlineDecoration, or LineThroughDecoration.

Return Value

GmagickDraw

The GmagickDraw object on success.

GmagickDraw settextencoding(string $encoding)

Specifies the code set to use for text annotations.

The only character encoding which may be specified at this time is "UTF-8" for representing Unicode as a sequence of bytes. Specify an empty string to set text encoding to the system's default. Successful text annotation using Unicode may require fonts designed to support Unicode.

Parameters

string $encoding

The text encoding.

Return Value

GmagickDraw

The GmagickDraw object on success.