PHP Classes

File: docs/classes/

Recommend this page to a friend!
  Classes of Jose Luis Quintana  >  GImage PHP Canvas to Image  >  docs/classes/  >  Download  
File: docs/classes/
Role: Example script
Content type: text/markdown
Description: Example script
Class: GImage PHP Canvas to Image
Create and compose canvas images from other images
Author: By
Last change:
Date: 1 year ago
Size: 783 bytes



Class file image Download


> Text class allows to use text to be embedded into Canvas.

Example below creates a text with opacity using a custom TTF font:

!!! tip "Tip"

Using `setWidth()` or `setHeight()` methods we can control the width and height of the text on canvas.


$text = new Text('My ustom text with opacity!');
    ->setColor(255, 255, 255)

// Used as layout
$layout = new Figure(350, 180);
    ->setBackgroundColor(300, 300, 300)

$canvas = new Canvas($layout);