Beispiel meiner GD-Grafik(Code):
$arr_satzteile = array();
$bold = "font/arialbd.ttf";
$normal = "font/arial.ttf";while(strpos($zeile1,'<b>') !== false)
{
$int_pos = strpos($zeile1,'<b>');$str_normal = substr($zeile1,0,$int_pos);
$str_bold = substr($zeile1,$int_pos+3,(strpos($zeile1,'</b>')-$int_pos-3));if($int_pos > 0)
{
$arr_satzteile[] = array('TEXT' => $str_normal,'FONT' => $normal);
}$arr_satzteile[] = array('TEXT' => $str_bold ,'FONT' => $bold);
$zeile1 = substr($zeile1,strpos($zeile1,'</b>')+4);
}if(strlen($zeile1) > 0)
$arr_satzteile[] = array('TEXT' => $zeile1 ,'FONT' => $normal);$im1 = imagecreate (240, 50);
$black1 = ImageColorAllocate ($im1, 0, 0, 0);
$white1 = ImageColorAllocate ($im1, 255, 255, 255);$int_startposX = 4;
$int_startposY = 16;
$int_startposX2 = 4;
$int_startposY2 = 28;
$int_startposX3 = 4;
$int_startposY3 = 40;$arr_postext[2] = $int_startposX;
foreach($arr_satzteile as $arr_Text)
{
$arr_postext = ImageTTFText ($im1, 7, 0, $arr_postext[2], $int_startposY, $white1, $arr_Text['FONT'], $arr_Text['TEXT']);
}if (! headers_sent())
{
header('Content-Type: image/gif');
Imagepng ($im1);
}
ImageDestroy ($im1);Ich kann das ja dies nicht in 1 Variable verpacken .. oder geschweige ein include auf diesen Code machen.. er akzeptiert es nicht....??
@Tom: das ist noch der fertige Code was die GD Grafiken (Fett/Normal) anbelangt ;-)
gruss
cromafi
Wenn ich "$im1" ausgebe kommt: Resource id #14