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: fix docs typo
Date: 2 years ago
Size: 729 bytes


Class file image Download


> Figure class allows to create rectangles or ellipses shapes.

The following example creates a rectangle, set opacity to 75% and save it as PNG:


use GImage\Figure;

$rectangle = new Figure(400, 250);
    // Figures are rectangles by default
    // ->isRectangle()
    ->setBackgroundColor(0, 0, 255)

As above example, we can also create an ellipse:


use GImage\Figure;

$ellipse = new Figure(300, 300);
    // Figure as an Elipse
    ->setBackgroundColor(255, 0, 0)

For more information send a message to info at phpclasses dot org.