here is the class i have so far
<?php
class txt2img {
var $image;
var $headertype;
var $forecolor;
var $fontsize;
var $fontangle;
var $font;
var $string;
//font size
function fontsize($fontsize) {
return $this->fontsize;
}
//forecolor
function forecolor($forecolor) {
return this->imagecolorallocate($this->img(),$this->forecolor);
}
//image file
function img($image) {
return imagecreatefrompng($this->img);
}
function display($string,$font) {
//display all errors
ini_set("display_errors", "1");
error_reporting(E_ALL);
header('content-type: image/png');
$fcolor = $this->forecolor();
imagettftext($this->img(),$this->fontsize(),0,0,$this->forecolor(),$this->font,$this->string);
imagejpg($this->img());
imagedestroy($this->img());
}
}
?>
anyone have any idea? either its late or i dont know, for some reason i feel blank when writing this one.
i want to be able to write the attribs first like
$gd = new gd; $gd->fontsize('12'); ..etc
then the actual output would be written like this
$gd->display('this is my string','myfont.ttf');