PHP Classes

File: docs/content/classes/

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