PHP Classes

File: gdExtImage_Test.php

Recommend this page to a friend!
  Classes of Victor Akinyemi  >  PHP GIF Animation Class  >  gdExtImage_Test.php  >  Download  
File: gdExtImage_Test.php
Role: Example script
Content type: text/plain
Description: Demonstration of gdExtImage's capabilities.
Class: PHP GIF Animation Class
Draw graphics and generate animated GIF images
Author: By
Last change:
Date: 7 years ago
Size: 1,647 bytes
 

Contents

Class file image Download
<?php
$t
= time();
require_once
'gdExtImage.class.php';
require_once
'gdExtFactory.class.php';
require_once
'gdExtWrapper.class.php';
ob_clean();
ob_start();
$factory = new gdExtFactory;
$gd = new GD;
$image = new gdExtImage(640,480);
$wm1 = gdExtImage::fromFile('1.png');
//$wm1->rotate(100);
$wm2 = gdExtImage::fromFile('2.png');
#$gd->AlphaBlending($image->getPointer(),false);
#$gd->SaveAlpha($image->getPointer(),true);
#$image->makeTransparentBG();
$image->drawRect(0,0,20,30,0xFFFFFF00);
$image->fillRect(0,0,20,30,$factory->makeRGBA(255,0,255,64));
$image->drawCircle(120,50,40,0x0000FF00);
$image->fillCircle(120,50,40,0x0000FF40);
$image->addWaterMark($wm1,'random');
$image->addWaterMark($wm2,'random');
$image->renderText(120,100,5,'gdExt Library',0x00FF0000);
$image->fillEllipse(120+($gd->FontWidth(5)*14)/2,100+($gd->FontHeight(5)/2),$gd->FontWidth(5)*14+5,$gd->FontHeight(5)+10,0x00FFFF40);
$image->fillRoundRect(118,120,120+$gd->FontWidth(5)*12+5,120+$gd->FontHeight(5),5,0xFF00FF00);
$image->renderText(120,120,5,'Rebooted API',0xFF000000);
$image->drawRoundRect(0,320,50,350,5,0xFFFFFF00);
$image->fillRoundRect(320,10,350,50,5,0xFF00FF00);
$image->drawLine(0,240,640,240,$factory->makeRGB(255,255,255));
$image->drawPolygon(array(320,250,300,310,340,310),3,0xEF0AFF40);
$image->fillPolygon(array(320,251,301,309,339,309),3,0xEFFAFF00);
$image->resize(800,600);
#header('Content-Type: image/png');
echo $image->generateHTML('png');
$image->save('png',false,'gdext.png');
$t2 = time();
$tt = $t2 - $t;
$fh = fopen("time.txt","w");
fwrite($fh,"It took: $tt\n");
fclose($fh);
ob_end_flush();

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