Hallo Breadfish,
Ich habe ein Problem und zwar habe ich ein Tutorial gefunden für Dyn SIgnatur bisher klappte alles aber jetzt kriege ich einen Error und zwar :
"die grafik kann nicht angezeigt werden weil sie fehler enthält"
Code
// Creating of the .png image.
header('Content-Type: image/png;');
$im = @imagecreatefrompng('mypicture.png') or die("Cannot select the correct image. Please contact the webmaster."); // Don't forget to put your picture there.
$text_color = imagecolorallocate($im, 197,197,199); // RED, GREEN, BLUE --> Go to www.colorpicker.com, select a nice color. Copy the R/G/B letters provided by colorpicker and put them here.
$text_username = "$Name"; // This gets the information about player name to be showed in the picture.
$text_score = "$Score"; // Same as above ^^
$text_money = "$Money"; // Same as above ^^
$font = 'myfont.ttf'; //Upload your custum font to the directory where this file is placed. Then change the name here.
/* USAGE OF THE imagettftext: First ($im) shouldn't be changed. (16) is the text-size. (0) is the angle of your text. Change it, and you'll see what's going on. (20) is de X-coordinate of the text.
(36) is the Y-coordinate of the text. */
imagettftext($im, 16, 0, 20, 36, $text_color, $font, $text_username); // Prints the username in the picture.
imagettftext($im, 16, 0, 72, 69, $text_color, $font, $text_score); // Prints the score in the picture.
imagettftext($im, 16, 0, 72, 99, $text_color, $font, $text_money); // Prints the money in the picture.
imagepng($im);
imagedestroy($im);
} else echo('Username is not in our database. Please try again.'); // If the username doesn't exist (so the row is 0) then it'll give en error.
mysql_close();
?>
Alles anzeigen