<?php

		/*
		int imagestring (int im, int font, int x, int y, string s, int col)
		
		   1. im: A reference to an image canvas created using the imagecreate function
		   2. font: An integer value specifying the number of the font to draw the text in. If font is 1, 2, 3, 4 or 5, then a built-in font is used
		   3. x: The horizontal displacement from the left of the image where the text will be drawn from, measured in pixels.
		   4. y: The vertical displacement from the top of the image where the text will be drawn from, measured in pixels.
		   5. s: The text to be drawn on the image
		   6. col: The color that the text will be painted. A reference to a color created using the imagecolorallocate function.
		*/
		
		//obter o valor do desconto 
		$desc = $_GET["dsc"];
		$desc = $desc."%";
		
		//obter o tipo de imagem
		$img = $_GET["img"];
	
		header("Content-type: image/gif");
		$im = @imagecreatefromgif($img);
		//or die("Cannot Initialize new GD image stream");
		//$background_color = imagecolorallocate($im, 0, 0, 0);
		$text_color = imagecolorallocate($im, 255, 255, 255);
		
		
		$font = 'arialbd.ttf';

		imagettftext($im, 11, 0, 10, 15, $text_color, $font, $desc); 
		
		
		//imagestring($im, 9, 11, 2,  $desc, $text_color);
		//imagegif($im);
		//imagedestroy($im);
		
		
		
		imagepng($im);
		imagedestroy($im); 
		

?>
