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

Class: WideImage_Canvas

Source Location: /Canvas.php

Class Overview




Variables

Methods



Class Details

[line 43]


[ Top ]


Class Variables

$font =  null

[line 47]



Tags:

access:  protected

Type:   mixed


[ Top ]

$handle =  0

[line 45]



Tags:

access:  protected

Type:   mixed


[ Top ]

$image =  null

[line 46]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 49]

WideImage_Canvas __construct( $img)



Parameters:

   $img  

[ Top ]

method setFont [line 55]

void setFont( $font)



Parameters:

   $font  

[ Top ]

method useFont [line 74]

object One useFont( string $file, [int $size = 12], [int $color = 0], [ $bgcolor = null], int $bgcolorBackground)

Creates and sets the current font

The supported font types are: TTF, PS, and GDF. Font type is detected from the extension. If the $file parameter doesn't have an extension, TTF font is presumed.

Note: not all parameters are supported by all fonts.




Tags:

return:  of the WideImage_Font_* objects


Parameters:

string   $file   Font file name (string)
int   $size   Font size (supported for TTF and PS fonts, ignored for GDF)
int   $color   Text color
int   $bgcolorBackground   color (supported only for PS font, ignored for TTF and PS)
   $bgcolor  

[ Top ]

method writeText [line 105]

void writeText( int $x, int $y, string $text, [int $angle = 0])

Write text on the image at specified position

You must set a font with a call to WideImage_Canvas::setFont() prior to writing text to the image.




Parameters:

int   $x   Left
int   $y   Top
string   $text   Text to write
int   $angle   The angle, defaults to 0

[ Top ]

method __call [line 131]

void __call( $method, $params)

A magic method that allows you to call any PHP function that starts with "image".

This is a shortcut to call custom functions on the image handle.

Example:

  1.  $img WideImage::load('pic.jpg');
  2.  $canvas $img->getCanvas();
  3.  $canvas->filledRect(10102030$img->allocateColor(000));
  4.  $canvas->line(608030100$img->allocateColor(25500));




Parameters:

   $method  
   $params  

[ Top ]


Documentation generated on Sat, 31 Jul 2010 20:37:57 +0200 by phpDocumentor 1.4.2