Important notice: the development of WideImage 1.0 branch is discontinued.
Please visit
http://wideimage.sourceforge.net for the new version of library and documentation.
This web site will remain accessible to serve as documentation for the old versions of the library.
For help on migration, please refer
to the
migration
guide.
Most recent edit on 2007-09-26 12:24:01 by GasperKozak
Additions:
Notes
Canvas is still in early developement and is marked as unstable, as it may change noticeably for the 1.0 final release.
Oldest known version of this page was edited on 2007-09-26 12:21:35 by GasperKozak []
Page view:
wiCanvas::drawText()
See:
List of operations
Signature
wiCanvas::drawText($left, $top, $text, $angle = 0)
Parameters
- $left (int): x-position of the text
- $top (int): y-position of the text
- $text (string): text to write
- $angle (int): rotation angle, in degrees, clock-wise
Description
This method writes text on a canvas
Examples
$img = wiImage::load('/path/to/an/image.png');
$canvas = $img->getCanvas();
// create and set a font
$white = $img->allocateColor(255, 255, 255);
$font = new wiFont_TTF("Arial", 15, $white);
$canvas->setFont($font);
// write the text
$canvas->writeText(15, 15, 'Hi :)');
CategoryDocApi CategoryUnstableApi