PHP gevorderde |
|
Tja, hiervoor heb ik denk ik al vijf dagen geleden een script gepost bij sitemasters. Aangezien hun hier geen haast mee hebben om het goed te keuren kan ik je nog geen link sturen.
script:
function Texttoimage($text, $size, $width, $length, $top = 15, $left= 15){
$imagetype = "image/png"; // The type of image that you want to display
$path = "Templates/Black/";
$font = "xirod.ttf";
//header("content-type: ".$imagetype."");
$image = ImageCreate($width, $length); //Creating image and establishing length and width
$background = ImageColorAllocate($image, 64,128,128); //Creatig backgroundcolor with RGB-values
$kleur = ImageColorAllocate($image, 238,235,235); //Define and create color of text with RGB-values
ImageTTFText($image, $size, 0, $left , $top, $kleur, $path.$font, $text); //Setting all the values for image
$readyimage = ImagePng($image);//Creating image
return $readyimage; //Output the image back to the sender
ImageDestroy($image);//Deleting image from memory
}
function Texttoimage($text, $size, $width, $length, $top = 15, $left= 15){ $imagetype = "image/png"; // The type of image that you want to display $path = "Templates/Black/"; $font = "xirod.ttf"; //header("content-type: ".$imagetype.""); $image = ImageCreate($width, $length); //Creating image and establishing length and width $background = ImageColorAllocate($image, 64,128,128); //Creatig backgroundcolor with RGB-values $kleur = ImageColorAllocate($image, 238,235,235); //Define and create color of text with RGB-values ImageTTFText($image, $size, 0, $left , $top, $kleur, $path.$font, $text); //Setting all the values for image $readyimage = ImagePng($image);//Creating image return $readyimage; //Output the image back to the sender ImageDestroy($image);//Deleting image from memory }
Het aanroepen van deze functie:
Texttoimage("Inloggen", "7", "400", "60", "30", "5");
Texttoimage("Inloggen", "7", "400", "60", "30", "5");
succes ermee! |