PHP Classes

File: examples/ellipse.php

Recommend this page to a friend!
  Classes of Jose Luis Quintana   GImage PHP Canvas to Image   examples/ellipse.php   Download  
File: examples/ellipse.php
Role: Example script
Content type: text/plain
Description: Example script
Class: GImage PHP Canvas to Image
Create and compose canvas images from other images
Author: By
Last change: docs: improve example pages and code files
refactor: minor project docs updates
Date: 1 year ago
Size: 591 bytes
 

Contents

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

/**
 * Creating an Ellipse.
 *
 * @author Jose Quintana <https://joseluisq.net>
 */

namespace GImage\Examples;

use
GImage\Figure;

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

$figure = new Figure(300, 200);
$figure
   
->isEllipse()
    ->
setBackgroundColor(255, 0, 0)
    ->
setOpacity(0.5)
    ->
create()
    ->
save(__DIR__ . '/ellipse.png');