Login   Register  
PHP Classes
elePHPant
Icontem

File: justdemo.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 9 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();
?>