//exit();
$this->show();
}
function createtext($instring)
{
$outstring=;
$max=strlen($instring);
for($i=0;$i {
$h=ord($instring[$i]);
if($h>=160 && $i {
$outstring.=.base_convert(bin2hex(iconv(gb2312,ucs-2,substr ($instring,$i,2))),16,10).;;
$i++;
}
else
{
$outstring.=$instring[$i];
}
}
return $outstring;
}
function createjpeg()
{}
function show()
{
//输出头内容
header( content-type: image/png);
//建立图象
$image = imagecreate(400,300);
//定义颜色
$red = imagecolorallocate($image,255,0,0);
$white = imagecolorallocate($image,255,255,255);
$black=imagecolorallocate($image,0,0,0);
//填充颜色
imagefilledrectangle($image,0,0,200,200,$red);
//显示文字
$txt=$this->createtext($this->text);
//写入文字
imagettftext($image,$this->size, $this->angle, $this->showx, $this->showy,$white,$this->font,$txt);
//imagestring($image,5,50,10,$txt,$white);
//显示图形
imagejpeg($image);
imagedestroy($image);
}
}
//本类,并没有经过很好的考虑,只是简单的进行了封装,以后有机会,可能跟原来的图片类整合
?>