PHP Classes
elePHPant
Icontem

File: examples/rectangle.php

Recommend this page to a friend!
  Classes of Jose Luis Quintana  >  GImage  >  examples/rectangle.php  >  Download  
File: examples/rectangle.php
Role: Example script
Content type: text/plain
Description: Example script
Class: GImage
Create graphic images with a fluent interface
Author: By
Last change: fix doc comments
Date: 6 months ago
Size: 659 bytes
 

Contents

Class file image Download
<?php
/*
 * This file is part of GImage.
 *
 * (c) Josť Luis Quintana <https://git.io/joseluisq>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

/**
 * Creating a Rectangle.
 *
 * @author Josť Luis Quintana <https://git.io/joseluisq>
 */

namespace GImage\Examples;

use
GImage\Figure;

require
__DIR__ . '/_config.php';
require
__DIR__ . '/../tests/bootstrap.php';

// Tip: By default a Figure is a rectangle

$figure = new Figure(400, 250);
$figure
   
->isRectangle()
    ->
setBackgroundColor(0, 0, 255)
    ->
setOpacity(0.5)
    ->
create()
    ->
save(__DIR__ . '/reactangle.png');