PHP Classes

File: docs/content/classes/

Recommend this page to a friend!
  Classes of Jose Luis Quintana   GImage PHP Canvas to Image   docs/content/classes/   Download  
File: docs/content/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: 8 months 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);