PHP Classes

File: justdemo.php

Recommend this page to a friend!
  Classes of George Clarke   ATextImage   justdemo.php   Download  
File: justdemo.php
Role: Example script
Content type: text/plain
Description: Used with demo.html, Examples of left, center, and right justification of text.
Class: ATextImage
Layout and render text on images
Author: By
Last change:
Date: 18 years ago
Size: 772 bytes
 

Contents

Class file image Download
<?php
require "class.atextimage.php";
$timg = new ATextImage();
$fnt=($_GET['fnt'])?$_GET['fnt']:"arial.ttf";
$just=($_GET['j'])?$_GET['j']:"center";
$ht=($_GET['h'])?$_GET['h']:0;
$wd=($_GET['w'])?$_GET['w']:0;
if(
$_GET["txt"]){
 
$txt="".stripslashes($_GET["txt"])."";
 
$tx=explode("|",$txt);
 foreach(
$tx as $t)
 {
 
$timg->AddLine($t);
 }
}
$horz=($_GET['horz'])?$_GET['horz']:"center";
$vert=($_GET['vert'])?$_GET['vert']:"center";
$sz=($_GET['sz'])?$_GET['sz']:12;
$timg->SetFont($fnt,$sz);
$timg->SetBackground(255,255,255);
$timg->SetTextColor(150,0,0);
$timg->SetPos($vert,$horz,$just); // (horizontal,vertical) positions
//$timg->CreateImage("d:\wwwsites\gaclarkecom\www\lava.gif");
$timg->MakeImage($wd,$ht);
$timg->ShowGif();
?>