Hallo,
wer kann mir weiterhelfen?
Ich versuche ein transparentes Bild mit Text zu erzeugen.
Bei ImageCreateFromPNG kommt ein Bild mit normalem Text,
aber eben nicht transparent.
Erzeuge ich das Image mit ImageCreate(20, 13) ist das
Bild wohl transparent, aber der Text ist sonderbar groß
und ein ungewöhnlicher Font.
<?php
// transparent
$image = "gelb.png";
$a = "Text";
header ("Content-type: image/png");
//$im = ImageCreateFromPNG("$image");
$im = ImageCreate(20, 13);
$w = ImageColorAllocate ($im, 255, 255, 0);
ImageColorTransparent($im, $w);
$tc = ImageColorAllocate ($im, 6, 50, 148);
ImageString($im, 2, 5, 0, $a, $tc);
ImagePng($im);
ImageDestroy ($im);
?>
Grüße
aklotus
							
						
					wer kann mir weiterhelfen?
Ich versuche ein transparentes Bild mit Text zu erzeugen.
Bei ImageCreateFromPNG kommt ein Bild mit normalem Text,
aber eben nicht transparent.
Erzeuge ich das Image mit ImageCreate(20, 13) ist das
Bild wohl transparent, aber der Text ist sonderbar groß
und ein ungewöhnlicher Font.
<?php
// transparent
$image = "gelb.png";
$a = "Text";
header ("Content-type: image/png");
//$im = ImageCreateFromPNG("$image");
$im = ImageCreate(20, 13);
$w = ImageColorAllocate ($im, 255, 255, 0);
ImageColorTransparent($im, $w);
$tc = ImageColorAllocate ($im, 6, 50, 148);
ImageString($im, 2, 5, 0, $a, $tc);
ImagePng($im);
ImageDestroy ($im);
?>
Grüße
aklotus
 
          
 transparentes Bild
									
									
									transparentes Bild
								
Kommentar