<?
session_start();
require_once('../../drawing_functions.php');

$_SESSION["display"]["title_text"] = $_GET["text"];
$_SESSION["display"]["title_colour"] = $_GET["color"];

header ("Content-type: image/gif");
$string = $_SESSION["display"]["title_text"];
$font  = 5;
$width  = ImageFontWidth($font)* strlen($string) ;
$height = ImageFontHeight($font);

$im = ImageCreateFrompng("Left_bottom.png");

$R = hexdec(substr($_SESSION["display"]["title_colour"],0,2));
$G = hexdec(substr($_SESSION["display"]["title_colour"],2,2));
$B = hexdec(substr($_SESSION["display"]["title_colour"],4,2));

$text_color = imagecolorallocate ($im, $R,$G,$B);

$x=18;
$y=9;
imagettftextalign($im, 20, 0, 0, 36, $text_color, "../../FreeSans.ttf", $string, 200, 'R');
//imagestring ($im, $font, $x, $y,  $string, $text_color);
$im = imagerotate($im, 90, 0);

imagegif($im);
?>