Class: Canvas
Source Location: /graphics.inc.php
Object
|
--Persistent
|
--Canvas
Canvas provides an abstract drawing space for objects that must render their own images.
Author(s):
|
|
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Class Methods
constructor __construct [line 1274]
Canvas __construct(
[
$aowner = null])
|
|
Overrides Object::__construct() (Constructs an object and initializes its data before the object is first used.)
Parameters:
method arc [line 1412]
void arc(
int
$x1, int
$y1, int
$x2, int
$y2, int
$x3, int
$y3, int
$x4, int
$y4)
|
|
Draws an arc on the image along the perimeter of the ellipse bounded by the specified rectangle. Use Arc to draw an elliptically curved line with the current Pen. The arc traverses the perimeter of an ellipse that is bounded by the points (X1,Y1) and (X2,Y2). The arc is drawn following the perimeter of the ellipse, counterclockwise, from the starting point to the ending point. The starting point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X3,Y3). The ending point is defined by the intersection of the ellipse and a line defined by the center of the ellipse and (X4, Y4).
Parameters:
method beginDraw [line 1368]
Begins draw cycle. In VCL for PHP, graphics are drawn on the browser using javascript, and this method is needed to dump the required code to initialize drawing objects and to establishes internal Canvas object. Should be followed by EndDraw to push drawing to the page canvas.
method bevelLine [line 1677]
void bevelLine(
$color,
$x1,
$y1,
$x2,
$y2)
|
|
Draw the line using specified color
Parameters:
method bevelRect [line 1664]
void bevelRect(
$x1,
$y1,
$x2,
$y2,
$color1,
$color2)
|
|
Draw Bevel-like rectangle using specified colors
Parameters:
method clear [line 1688]
Clears the canvas Use this method to erase all the drawings in the canvas
method ellipse [line 1432]
void ellipse(
int
$x1, int
$y1, int
$x2, int
$y2)
|
|
Draws the ellipse defined by a bounding rectangle on the canvas. Call Ellipse to draw a circle or ellipse on the canvas. Specify the bounding rectangle by giving the top left point at pixel coordinates (X1, Y1) and the bottom right point at (X2, Y2). If the bounding rectangle is a square, a circle is drawn. The ellipse is outlined using the value of Pen, and filled using the value of Brush.
Parameters:
method endDraw [line 1383]
Ends draw cycle. In VCL for PHP, graphics are drawn on the browser using javascript, and this method is needed to dump the required code to finalize drawing and to flush out all drawing commands.
method fillRect [line 1450]
void fillRect(
int
$x1, int
$y1, int
$x2, int
$y2)
|
|
Fills the specified rectangle on the canvas using the current brush. Use FillRect to fill a rectangular region using the current brush. The region is filled including the top and left sides of the rectangle, but excluding the bottom and right edges.
Parameters:
method forceBrush [line 1292]
Intermal method This method is used to set the color for the canvas to the brush color if the brush has been modified.
Tags:
method forceFont [line 1325]
Intermal method This method is used to set the font for the canvas to the font property
Tags:
method forcePen [line 1308]
Intermal method This method is used to set the stroke color for the canvas to the pen color if the pen has been modified.
Tags:
method frameRect [line 1469]
void frameRect(
int
$x1, int
$y1, int
$x2, int
$y2)
|
|
Draws a rectangle using the Brush of the canvas to draw the border. Use FrameRect to draw a 1 pixel wide border around a rectangular region. FrameRect does not fill the interior of the rectangle with the Brush pattern. To draw a boundary using the Pen instead, use the Polygon method.
Parameters:
method getBrush [line 1716]
Determines the color and pattern for filling graphical shapes and backgrounds. Set the Brush property to specify the color and pattern to use when drawing the background or filling in graphical shapes. The value of Brush is a Brush object. Set the properties of the Brush object to specify the color and pattern or bitmap to use when filling in spaces on the canvas. Note: Setting the Brush property replaces the specified Brush object, rather than copying the current Brush object.
method getFont [line 1730]
Specifies the font to use when writing text on the image. Set Font to specify the font to use for writing text on the image. The value of Font is a Font object. Set the properties of the Font object to specify the font face, color, size, style, and any other aspects of the font. Note: Setting the Font property replaces the specified Font object, rather than copying the current Font object.
method getPen [line 1743]
Specifies the kind of pen the canvas uses for drawing lines and outlining shapes. Set Pen to specify the pen to use for drawing lines and outlining shapes in the image. The value of Pen is a Pen object. Set the properties of the Pen object to specify the color, style, width, and mode of the pen. Note: Setting the Pen property replaces the specified Pen object, rather than copying the current Pen object.
method initLibrary [line 1335]
This method dumps the .js required to initiate graphic library
method line [line 1486]
void line(
int
$x1, int
$y1, int
$x2, int
$y2)
|
|
Draws a line on the canvas using specified coordinates Use Line to draw a 1 pixel wide line from a point (x1,y2) to another point (x2,y2) using the current Pen
Parameters:
method paint [line 1699]
Paints the canvas After drawing this does the actual painting of the canvas. Only needed when drawing from JavaScript events or from outside this canvas owner OnPaint event.
method polygon [line 1502]
void polygon(
array
$points)
|
|
Draws a series of lines on the canvas connecting the points passed in and closing the shape by drawing a line from the last point to the first point. Use Polygon to draw a closed, many-sided shape on the canvas, using the value of Pen. After drawing the complete shape, Polygon fills the shape using the value of Brush. The Points parameter is an array of points that give the vertices of the polygon.
Parameters:
method polyline [line 1533]
void polyline(
array
$points)
|
|
Draws a series of lines on the canvas with the current pen, connecting each of the points passed to it in Points. Use Polyline to connect a set of points on the canvas. If you specify only two points, Polyline draws a single line. The Points parameter is an array of points to be connected.
Parameters:
method rectangle [line 1569]
void rectangle(
int
$x1, int
$y1, int
$x2, int
$y2)
|
|
Draws a rectangle on the canvas. Use Rectangle to draw a rectangle using Pen and fill it with Brush. Specify the rectangle’s coordinates giving four coordinates that define the upper left corner at the point (X1, Y1) and the lower right corner at the point (X2, Y2). To fill a rectangular region without drawing the boundary in the current pen, use FillRect. To outline a rectangular region without filling it, use FrameRect or Polygon. To draw a rectangle with rounded corners, use RoundRect.
Parameters:
method roundRect [line 1593]
void roundRect(
int
$x1, int
$y1, int
$x2, int
$y2, int
$w, int
$h)
|
|
Draws a rectangle with rounded corners on the canvas. Use RoundRect to draw a rounded rectangle using Pen and fill it with Brush. The rectangle will have edges defined by the points (X1,Y1), (X2,Y1), (X2,Y2), (X1,Y2), but the corners will be shaved to create a rounded appearance. The curve of the rounded corners matches the curvature of an ellipse with width W and height H. To draw an ellipse instead, use Ellipse. To draw a true rectangle, use Rectangle.
Parameters:
method setBrush [line 1717]
method setCanvasProperties [line 1354]
void setCanvasProperties(
$Name)
|
|
Parameters:
method setFont [line 1731]
method setPen [line 1744]
method stretchDraw [line 1642]
void stretchDraw(
int
$x1, int
$y1, int
$x2, int
$y2, string
$image)
|
|
Draws the graphic specified by the image parameter in the rectangle specified by the coordinates. Call StretchDraw to draw a graphic on the canvas so that the image fits in the specified rectangle. This may involve changing magnification and/or aspect ratio.
Parameters:
method textOut [line 1656]
void textOut(
int
$x, int
$y, string
$text)
|
|
Writes a string on the canvas, starting at the point (X,Y) Use TextOut to write a string onto the canvas. The string will be written using the current value of Font.
Parameters:
Documentation generated on Sat, 13 Jun 2009 10:51:43 -0700 by phpDocumentor 1.4.1
|