PHP Classes

File: docs/classes/

Recommend this page to a friend!
  Classes of Jose Luis Quintana  >  GImage  >  docs/classes/  >  Download  
File: docs/classes/
Role: Example script
Content type: text/markdown
Description: Example script
Class: GImage
Create graphic images with a fluent interface
Author: By
Last change: fix docs typo
Date: 28 days 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)