PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Daniel Czuba   Image.class   example1.php   Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: Example how to use this class
Class: Image.class
Generate images defined programmatically
Author: By
Last change:
Date: 14 years ago
Size: 600 bytes
 

Contents

Class file image Download
<?php // example1.php

require 'Image.class.php';

$image = new Image( 640, 480, '123456' );
$image->setColor( '004444' ); // every time you want to use 'new' color, you need to set it
$image->drawFilledRectangle( 280, 50, 600, 340 );
$image->setColor( 'aa3333' );
$image->drawFilledEllipse( 200, 210, 340, 440 );
$image->setColor( 'ff00ff' );
$image->drawRectangle( 340, 200, 400, 400 );
$image->setColor( 'ff00ff' );
$image->drawLineX( 40 );
$image->setColor( '0aa0f0' );
$image->drawLineX( 60 );
$image->drawLineX( 61 );
$image->drawLineX( 62 );
$image->drawLineX( 63 );

$image->output( 'png' );