PHP Classes

File: TestToImageExample.php

Recommend this page to a friend!
  Classes of Er. Rochak Chauhan   Text To Image   TestToImageExample.php   Download  
File: TestToImageExample.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: Text To Image
Render a text string as an image
Author: By
Last change: Uploaded Version 2: Added new features to display and/or save created image.
Date: 18 years ago
Size: 776 bytes
 

Contents

Class file image Download
<?php

error_reporting
(E_ALL);
ini_set("display_errors",1);



require_once(
'TextToImage.inc.php');
$textToImage = new ConvertTextToImage;
$textToImage->initializeImage(200, 150, 'white', 'red');

/*
// Optional Check - verify if the color entered by user is a web safe color
if($textToImage->isWebSafeColor($color)) {
   // .... procede
}
else {
  // ... display warning !
}
*/

//$textToImage->ShowTextAsPng(10, 2,2, 'Hello World');
//$textToImage->ShowTextAsJpg(10, 2,2, 'Rochak');
//$textToImage->ShowTextAsGif(10, 11,11, 'Hello dude');

//$textToImage->SaveTextAsGif(10, 11,11, 'Hello dude','hello');
//$textToImage->SaveTextAsJpg(10, 11,11, 'Hello dude','filename');
$textToImage->SaveTextAsPng(10, 11,11, 'Hello dude','filename');


?>