<?php
// example of use
require ("include/class_MyImage.php");
// ----------------------------
// Init class.
$image=new MyImage("");
$image->NewImage("image","pergam.jpg"); // this is out background
$labim="th0001.jpg";
$image->NewImage("label",$labim); // image to add
$image->AddBord("rgb(220,220,220)",10,10,"label"); // to this image we add a border
$image->AddBord("black",1,1,"label"); // and also another
$image->AddText("your choice","red","ariblk.ttf",30,0,true,0,0,"label"); // a text centered
$image->do_image("label"); // add the text to image
// $image->ResetStoredText(); // we don't heed this line since it's done automatically
$image->NewImage("home","home.png"); // load other images
$image->NewImage("tul","TUL2.png");
$image->AddToImage("label",200,290); // add images to backgraound
$image->AddToImage("home",1120,860);
$image->AddToImage("tul",634,340);
//
// now we put into array storage all the text we want to add
//
$image->AddText("Tenuta di Costa Prà","#000044","CPfont.ttf",72,0,true,0,-350);
$image->AddText("hereby certifies that this","black","arial.ttf",24,0,true,0,-290);
$image->AddText("belongs to","black","arial.ttf",24,0,true,0,100);
$image->AddText("bottle named","black","arial.ttf",24,0,true,0,-180);
// the followinf text uses a font to big. We allow olny the 36% (.9*.4) of space for it.
// font size will be reduced
$image->AddText("your choice may be too long","red","ariblk.ttf",60,0,true,0,-80,"image",.4);
$image->AddText("signed for Costa Prà","black","arial.ttf",16,0,true,0,300);
$image->AddText("Mauro Zabot","black","arial.ttf",12,0,true,0,316);
$image->AddText("____________________","black","arial.ttf",12,0,true,0,322);
$image->AddText("http://www.TheUniqueLabels.com/","black","arial.ttf",18,0,false,230,920);
$image->AddText("http://www.Costapra.com/","black","arial.ttf",18,0,false,230,940);
// special font with signature
$image->AddText("CD","black","ESIGS.ttf",72,-5,false,710,890);
// finally we add a text with initials different fron the body of the words
// also this text is to long and will be resized
$image->AddSplitText("If Your Name is too long we make it smaller","gothic.ttf",100,"#FF0000","gothic.ttf",100,"black",0,130,"image",0.85);
// add all wath's stored to image
$image->do_image();
// a final bord
$image->AddBord("rgb(220,220,220)",95,95);
//
// and we send it to scrren
$image->toScreen();
// and also write to images to hd
$image->toFile("test",0,"label");
$image->toFile("test2");
?>