Image_Graph
[ class tree: Image_Graph ] [ index: Image_Graph ] [ all elements ]

Class: Image_Graph_Driver_GD

Source Location: /Image_Graph-0.3.0/Graph/Driver/GD.php

Class Overview

Image_Graph_Driver
   |
   --Image_Graph_Driver_GD

GD Driver class.


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • Copyright (C) 2003, 2004 Jesper Veggerby Hansen

Methods


Child classes:

Image_Graph_Driver_GD_GIF
GD GIF Driver class.
Image_Graph_Driver_GD_JPG
GD JPEG Driver class.
Image_Graph_Driver_GD_PNG
GD PNG Driver class.
Image_Graph_Driver_GD_WBMP
WBMP Driver class.

Inherited Variables

Inherited Methods

Class: Image_Graph_Driver

Image_Graph_Driver::Image_Graph_Driver()
Create the driver.
Image_Graph_Driver::done()
Output the result of the driver
Image_Graph_Driver::ellipse()
Draw an ellipse
Image_Graph_Driver::endGroup()
End the "current" group.
Image_Graph_Driver::factory()
Driver factory method.
Image_Graph_Driver::getHeight()
Get the height of the canvas
Image_Graph_Driver::getWidth()
Get the width of the canvas
Image_Graph_Driver::line()
Draw a line
Image_Graph_Driver::overlayImage()
Overlay image
Image_Graph_Driver::pieSlice()
Draw a pie slice
Image_Graph_Driver::polygonAdd()
Adds vertex to a polygon
Image_Graph_Driver::polygonEnd()
Draws a polygon
Image_Graph_Driver::rectangle()
Draw a rectangle
Image_Graph_Driver::setDefaultFont()
Sets the default font options.
Image_Graph_Driver::setFill()
Sets the style of the filling of drawn objects.
Image_Graph_Driver::setFillColor()
Sets the color of the filling of drawn objects
Image_Graph_Driver::setFillImage()
Sets an image that should be used for filling
Image_Graph_Driver::setFont()
Sets the font options.
Image_Graph_Driver::setGradientFill()
Sets a gradient fill
Image_Graph_Driver::setLineColor()
Sets the color of the line(s) to be drawn
Image_Graph_Driver::setLineThickness()
Sets the thickness of the line(s) to be drawn
Image_Graph_Driver::splineAdd()
Adds vertex to a polygon
Image_Graph_Driver::splineEnd()
Draws a polygon
Image_Graph_Driver::startGroup()
Start a group.
Image_Graph_Driver::textHeight()
Get the height of a text,
Image_Graph_Driver::textWidth()
Get the width of a text,
Image_Graph_Driver::write()
Writes text

Class Details

[line 71]
GD Driver class.


[ Top ]


Method Detail

Image_Graph_Driver_GD (Constructor)   [line 139]

Image_Graph_Driver_GD &Image_Graph_Driver_GD( array $param)

Create the GD driver.

Parameters available:

'antialias' Set to true if line antialiasing should be enabled, this is the built in GD antialiasing, which causes lines with a linestyle to disappear and lines with a thickness > 1 to display as = 1. This does also not look good when displaying "short" lines as fx. done with a smooth line/area chart. Use it for best results with a line chart having few datapoints.

'width' The width of the graph on the canvas

'height' The height of the graph on the canvas

'left' The left offset of the graph on the canvas

'top' The top offset of the graph on the canvas

'filename' An image to open, on which the graph is created on

'gd' A GD resource to add the image to, use this option to continue working on an already existing GD resource. Make sure this is passed 'by- reference' (using &)

'gd' and 'filename' are mutually exclusive with 'gd' as preference

'width' and 'height' are required unless 'filename' or 'gd' are specified, in which case the width and height are taken as the actual image width/height. If the latter is the case and 'left' and/or 'top' was also specified, the actual 'width'/'height' are altered so that the graph fits inside the canvas (i.e 'height' = actual height - top, etc.)


Parameters:

array   $param   —  Parameter array

[ Top ]

ellipse   [line 900]

void ellipse( int $x, int $y, int $rx, int $ry, [mixed $fillColor = false], [mixed $lineColor = false])

Draw an ellipse

Overrides Image_Graph_Driver::ellipse() (Draw an ellipse)

Parameters:

int   $x   —  Center point x-value
int   $y   —  Center point y-value
int   $rx   —  X-radius of ellipse
int   $ry   —  Y-radius of ellipse
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

line   [line 634]

void line( int $x0, int $y0, int $x1, int $y1, [mixed $color = false])

Draw a line

Overrides Image_Graph_Driver::line() (Draw a line)

Parameters:

int   $x0   —  X start point
int   $y0   —  X start point
int   $x1   —  X end point
int   $y1   —  Y end point
mixed   $color   —  The line color, can be omitted

[ Top ]

overlayImage   [line 1150]

void overlayImage( int $x, int $y, string $filename, [int $width = false], [int $height = false], [ $alignment = false])

Overlay image

Overrides Image_Graph_Driver::overlayImage() (Overlay image)

Parameters:

int   $x   —  X-point of overlayed image
int   $y   —  Y-point of overlayed image
string   $filename   —  The filename of the image to overlay
int   $width   —  The width of the overlayed image (resizing if possible)
int   $height   —  The height of the overlayed image (resizing if possible)
   $alignment   — 

[ Top ]

pieSlice   [line 931]

void pieSlice( int $x, int $y, int $rx, int $ry, int $v1, int $v2, [int $srx = false], [int $sry = false], [mixed $fillColor = false], [mixed $lineColor = false])

Draw a pie slice

Overrides Image_Graph_Driver::pieSlice() (Draw a pie slice)

Parameters:

int   $x   —  Center point x-value
int   $y   —  Center point y-value
int   $rx   —  X-radius of pie slice
int   $ry   —  Y-radius of pie slice
int   $v1   —  The starting angle
int   $v2   —  The end angle
int   $srx   —  Starting X-radius of the pie slice i.e. for a doughnut)
int   $sry   —  Starting Y-radius of the pie slice (i.e. for a doughnut)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

polygonEnd   [line 654]

void polygonEnd( [bool $connectEnds = true], [mixed $fillColor = false], [mixed $lineColor = false])

Draws a polygon

Overrides Image_Graph_Driver::polygonEnd() (Draws a polygon)

Parameters:

bool   $connectEnds   —  Specifies whether the start point should be connected to the endpoint (closed polygon) or not (connected line)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

rectangle   [line 873]

void rectangle( int $x0, int $y0, int $x1, int $y1, [mixed $fillColor = false], [mixed $lineColor = false])

Draw a rectangle

Overrides Image_Graph_Driver::rectangle() (Draw a rectangle)

Parameters:

int   $x0   —  X start point
int   $y0   —  X start point
int   $x1   —  X end point
int   $y1   —  Y end point
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

setFillImage   [line 587]

void setFillImage( string $filename)

Sets an image that should be used for filling

Overrides Image_Graph_Driver::setFillImage() (Sets an image that should be used for filling)

Parameters:

string   $filename   —  The filename of the image to fill with

[ Top ]

setFont   [line 606]

void setFont( $fontOptions, array $font)

Sets the font options.

The $font array may have the following entries:

'ttf' = the .ttf file (either the basename, filename or full path) If 'ttf' is specified, then the following can be specified

'size' = size in pixels

'angle' = the angle with which to write the text


Overrides Image_Graph_Driver::setFont() (Sets the font options.)

Parameters:

array   $font   —  The font options.
   $fontOptions   — 

[ Top ]

splineEnd   [line 720]

void splineEnd( [bool $connectEnds = true], [mixed $fillColor = false], [mixed $lineColor = false])

Ends a spline

Overrides Image_Graph_Driver::splineEnd() (Draws a polygon)

Parameters:

bool   $connectEnds   —  Specifies whether the start point should be connected to the endpoint (closed polygon) or not (connected line)
mixed   $fillColor   —  The fill color, can be omitted
mixed   $lineColor   —  The line color, can be omitted

[ Top ]

textHeight   [line 1012]

int textHeight( string $text)

Get the height of a text,
  • Return: The height of the text

Overrides Image_Graph_Driver::textHeight() (Get the height of a text,)

Parameters:

string   $text   —  The text to get the height of

[ Top ]

textWidth   [line 980]

int textWidth( string $text)

Get the width of a text,
  • Return: The width of the text

Overrides Image_Graph_Driver::textWidth() (Get the width of a text,)

Parameters:

string   $text   —  The text to get the width of

[ Top ]

write   [line 1058]

void write( int $x, int $y, string $text, int $alignment, [mixed $color = false])

Writes text

Overrides Image_Graph_Driver::write() (Writes text)

Parameters:

int   $x   —  X-point of text
int   $y   —  Y-point of text
string   $text   —  The text to write
int   $alignment   —  The alignment of the text
mixed   $color   —  The color of the text

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:24:56 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.