PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Nikolai Zujev  >  text2image  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: text2image
Place text on an image
Author: By
Last change: Requirements
Date: 12 years ago
Size: 956 bytes
 

Contents

Class file image Download
<?
// Requirements:
// GD (2+) library for image manipulation
// for function CreateImageTrueColor - use GD 2.0+
//
// working sample
// http://80.235.107.98:89/Complete_Scripts/PHP/text2image/

   
require_once("class.txt2img.php");

   
$data = array('text' => 'Viva! Text on Image', // text
                 
'image' => 'bw.jpg', // input image
                 
'type' => 'png', // output image type - default jpeg
                 
'fontsize' => 5, // fontsize - default 3
                 
'color' => 'FFFFFF', // text color - default #000000
                 
'margin' => 5, // text margin in px - default 2
                 
'x' => 'center', // left, center, right - default center
                 
'y' => 'center'); // top, center, bottom - default center

   
$picObj = new txt2img( $data );
 
   
$picObj->render();

?>