Hi
ich versuche mich gerade darin in einem bestehendem png Bild einen Text hineinzuschreiben. Mir wird aber nur das Bild ausgegeben und der Text fehlt.... was mache ich falsch? Die ttf Datei liegt auf dem Server, Groß/Kleinschreibung hab ich schon beachtet
ich versuche mich gerade darin in einem bestehendem png Bild einen Text hineinzuschreiben. Mir wird aber nur das Bild ausgegeben und der Text fehlt.... was mache ich falsch? Die ttf Datei liegt auf dem Server, Groß/Kleinschreibung hab ich schon beachtet
PHP-Code:
header('Content-type: image/png');
$text = 'Test';
$font = 'Arial.ttf';
$size = 12;
$angle = 0;
$field = imagettfbbox($size, $angle, $font, $text);
$pos_x = 0;
$pos_y = 0;
$file = 'button1off.png';
$txt_color = ImageColorAllocate ($im, 0, 0, 0);
$size = getimagesize($file);
$image = imagecreatefrompng($file);
imagettftext($image, $size, $angle, $pos_x, $pos_y, $txt_color, $font, $text);
#imagecolortransparent($image, $bg_color);
imagepng($image);
imagedestroy($image);
Kommentar