Location: PHPKode > scripts > TriImage > triimage/graphic.php3
Header( "Content-type: image/gif");
Demonstration file for TriImage class
by Kris Kumler
--not much functionality right now, but is the basis for a future
revision in the works.  Will allow for easy placement of text on
graphics for watermarking, etc.  This will all be reduced to only a 
few lines to use :)
include( 'triImage.php3 ');

	$triImage = new TriImageClass;
        $string = "This image is not licensed\n\rfor public use. (c) US";
        $fontSize = 24;
        $font = "fonts/times.ttf";
        $im = imagecreatefromgif("first.gif");
        $black = ImageColorAllocate($im,0,0,0);
	$red = ImageColorAllocate($im,230,0,0);
	$tw = $triImage->getTextWidth($font,$fontSize,0,$string);
	$px = $triImage->getTextxPos($im,$tw);
	$th = $triImage->getTextHeight($font,$fontSize,0,$string);
	$py = $triImage->getTextyPos($im,$th);
        ImageTTFText($im,$fontSize,0,$px+1,$py+1,$black, $font, $string);
        ImageTTFText($im,$fontSize,0,$px,$py,$red, $font, $string);
Return current item: TriImage