Mailinglisten-Archive |
>Mit Internet explorer 3
>ist dass Bild gif sichtbar
>das .php3 bild kommt nur den alt text
Ähh, was willst du uns damit sagen?
>Selber probieren :-)
Habe ich gemacht. ich habe deinen Code ein bißchen
angepaßt:
Das GIF wird angezeigt und nur nach Bedarf (Wenn es noch
nicht da ist) neu erstellt.
Außerdem habe ich die Funktion so modifiziert, daß
der Dateiname unabhängig von der Aufschrift des Buttons ist.
Als Beispiel seien die Menü-Buttons auf
http://www.php-homepage.de genannt.
Nachfolgdens der Sourcecode.
Mark
<?
function machegif($fontsize,$text,$dateiname,$alt) {
$fontfile = "adler.ttf";
$fontangle = 0;
$dimtxt = ImageTTFBBox( $fontsize, $fontangle, $fontfile, $text
);
$border = 2;
$txtsizex = abs($dimtxt[4] - $dimtxt[0]);
$txtsizey = abs($dimtxt[5] - $dimtxt[1]);
$imgsizex = $txtsizex + 3*$border;
$imgsizey = $txtsizey + 5*$border;
$txtposx = $border;
$txtposy = $txtsizey + $border;
$im = imageCreate( $imgsizex, $imgsizey);
$col1 = imagecolorallocate($im, 153, 0, 51);
$col2 = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $col1);
imageTTFText($im, $fontsize, $fontangle, $txtposx, $txtposy,
$col2, $fontfile, $text );
if (!file_exists("$dateiname.gif")){
ImageGIF($im, "$dateiname.gif");
}
print "<img src=\"$dateiname.gif\" border=\"0\" alt=\"$alt\">";
}
?>
-----
Sent using MailStart.com ( http://MailStart.Com/welcome.html )
The FREE way to access your mailbox via any web browser, anywhere!
php::bar PHP Wiki - Listenarchive