Hallo,
Wenn ich ein Bild mit PHP erstelle und die funktion imagettftext verwende brauche ich ein Hintergrundbild ich wills allerdings ohne Hintergrundbild sondern nur Transparent. Ich machs so nur das ich ein Bild als Hintergrund habe.
Aber genau das will ich ja nicht sondern nur ein Transparenten Hintergrund und der die Größe anpasst.
Wenn ich ein Bild mit PHP erstelle und die funktion imagettftext verwende brauche ich ein Hintergrundbild ich wills allerdings ohne Hintergrundbild sondern nur Transparent. Ich machs so nur das ich ein Bild als Hintergrund habe.
PHP-Code:
<?php
header('Content-type: image/png');
$img = ImageCreateFromPNG("./images/transp.png");
$color = ImageColorAllocate($img, 255, 0, 0); //Farbe
$ttf = "./ttf/xyz.ttf"; //Schriftart
$ttfsize = 20; //Schriftgrösse
$text = "Test\nNachricht";
$angle = 0;
$t_x = 2;
$t_y = 40;
imagettftext($img ,$ttfsize, $angle, $t_x, $t_y, $color, $ttf, $text);
imagepng($img);
?>
Kommentar