PHP Classes

File: docs/examples/

Recommend this page to a friend!
  Classes of Jose Luis Quintana  >  GImage  >  docs/examples/  >  Download  
File: docs/examples/
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: 1 year ago
Size: 630 bytes



Class file image Download

Render images in-memory

The following example renders an image in-memory and return the string resource.


use GImage\Image;

$img = new Image();
$arch_url = '';

$resource = $img->load($arch_url)
    // Scale 120%
    // Rotate an image to -90
    // Change to PNG
    // Add opacity 70%
    // Render the image in-memory

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