File: examples/render.php

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


Class file image Download
 * This file is part of GImage.
 * (c) JosÚ Luis Quintana <>
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.

 * Render an image in-memory and return the resource.
 * @author JosÚ Luis Quintana <>

namespace GImage\Examples;


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

$image = new Image();
$resource = $image
// Scale 120%
// Rotate an image to -90║
// Change to PNG
// Add opacity 70%
// Render the image in-memory

// Output the buffer (example only)
header('Content-Type: image/png');
// Necessary for opacity to work
imagesavealpha($resource, true);
imagepng($resource, null);

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