30 lines
725 B
PHP
30 lines
725 B
PHP
|
|
<?php
|
||
|
|
// Test für GD Extension
|
||
|
|
header('Content-Type: image/png');
|
||
|
|
|
||
|
|
// Canvas erstellen (300x200px)
|
||
|
|
$image = imagecreatetruecolor(300, 200);
|
||
|
|
|
||
|
|
// Farben definieren
|
||
|
|
$background = imagecolorallocate($image, 0, 153, 204);
|
||
|
|
$text_color = imagecolorallocate($image, 255, 255, 255);
|
||
|
|
$border_color = imagecolorallocate($image, 0, 0, 0);
|
||
|
|
|
||
|
|
// Hintergrund füllen
|
||
|
|
imagefill($image, 0, 0, $background);
|
||
|
|
|
||
|
|
// Rahmen zeichnen
|
||
|
|
imagerectangle($image, 0, 0, 299, 199, $border_color);
|
||
|
|
|
||
|
|
// Text schreiben
|
||
|
|
$text = "GD funktioniert!";
|
||
|
|
imagestring($image, 5, 60, 80, $text, $text_color);
|
||
|
|
|
||
|
|
// Zeit anzeigen
|
||
|
|
$time = date('H:i:s');
|
||
|
|
imagestring($image, 3, 100, 120, "Zeit: $time", $text_color);
|
||
|
|
|
||
|
|
// Bild ausgeben
|
||
|
|
imagepng($image);
|
||
|
|
imagedestroy($image);
|