trunx: php-Grafik mit Text verpixelt...

Beitrag lesen

Hallo Forum,

ich habe ein paar buttons als php-Grafiken erzeugt, in denen Text eingebunden ist. Doch diese Grafiken sind total verpixelt und ich finde nicht den Grund dafür, hier ein Beispiel. Das ist doch ein Komprimierungsfehler, oder? Aber ich wüßte nicht, an welcher Stelle ich komprimiere...

Hier mal der php-code:

  
$fontfile = "../css/verdanab.ttf";  
$fontsize = 10;  
$imagewidth = 101;  
$imageheight = 20;  
$im = @imagecreatetruecolor($imagewidth, $imageheight)  
      or die();  
$text = $_REQUEST['txt'];  
$black = imagecolorallocate($im, 0x00, 0x00, 0x00);  
$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);  
$red = imagecolorallocate($im, 0xFF, 0x00, 0x00);  
if($_REQUEST['f']=="b")  
  $farbe = $black;  
elseif($_REQUEST['f']=="r")  
  $farbe = $red;  
imagefilledrectangle ($im, 1, 0, $imagewidth, $imageheight, $farbe);  
imagefilledrectangle ($im, 0, 0, 1, $imageheight, $white);  
$box = imagettfbbox($fontsize, 0, $fontfile, $text);  
$textwidth = abs($box[4] - $box[0]);  
$textheight = abs($box[5] - $box[1]);  
$xcord = ($imagewidth / 2) - ($textwidth / 2);  
$ycord = ($imageheight / 2) - ($textheight / 2);  
imagefttext($im, $fontsize, 0, $xcord, 15, $white, $fontfile, $text);  
header ("Content-type: image/jpeg");  
imagejpeg($im);  
imagedestroy($im);  

also, wie immer würde ich mich über eine Antwort freuen, ich würde dieses Problem wirklich gern verstehen...

bye trunx

--
Die Standard-Antwort: "Bitte benutze die Forum-Suche!" macht die Forum-Suche kaputt, weil die Suche dann nämlich genau vor allem diese dämliche Standard-Antwort, also Müll liefert. Sinnvoller ist stattdessen folgende Standard-Antwort: "Dieses Thema wurde schon vielfach im Forum besprochen, siehe z.B. <a>hier</a> oder <a>hier</a> oder benutze die Forum-Suche z.B. mit den Stichworten 'Stichwort1 Stichwort2'." Danke.