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:
Date: 2 years ago
Size: 545 bytes


Class file image Download

Image resource loading

The following example loads an image resource using the load($src) method.


use GImage\Image;

// Create a image rectangle (240x100)
$width = 240;
$height = 100;
$rectangle = imagecreatetruecolor($width, $height);
$green = imagecolorallocate($rectangle, 0, 255, 0);
imagefilledrectangle($rectangle, 0, 0, $width, $height, $green);

// Load and process the rectangle image resource
$img = new Image();
  // scale to 50%

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