 
			
				01/03/2010, 04:49
			
			
			     |  
        |     Moderador   |    |    Fecha de Ingreso: abril-2002  Ubicación: Torremolinos (Málaga)  
						Mensajes: 19.607
					  Antigüedad: 23 años, 6 meses Puntos: 1284     |        |  
  |      Respuesta: marcas de agua        Hola:  
Un ejemplo sencillo sin necesidad de una base de datos está en este código php:   
Código:
  <?
if (!function_exists('file_get_contents'))	{
	function file_get_contents($filename, $incpath = false, $resource_context = null)
	{
		if (false === $fh = fopen($filename, 'rb', $incpath))	{
			trigger_error('file_get_contents() failed to open stream: No such file or directory', E_USER_WARNING);
			return false;
		}
		clearstatcache();
		if ($fsize = @filesize($filename)) {
	
			$data = fread($fh, $fsize);
	
		}
		else	{
			$data = '';
		
			while (!feof($fh))	{
	
				$data .= fread($fh, 8192);
			}
	
		}
		fclose($fh);
		return $data;
	}
}
$id = $_GET["id"];
if ($id == "1") $url = "castillo-Almeria.jpg";
elseif ($id == "2") $url = "CostadelSol.jpg";
else $url = "volando.jpg";
$original = imagecreatefromstring(file_get_contents($url));
$ancho = imagesX($original);
$alto = imagesY($original);
$mini = imagecreatetruecolor(400, 300);
imagecopyresized($mini, $original, 0, 0, 0, 0, 400, 300, $ancho, $alto);
imagedestroy($original);
$marca = imagecreatefromgif("../dibujos/emoticon.gif");
$marcaX = imagesX($marca);
$marcaY = imagesY($marca);
imagecopy($mini, $marca, 360, 260, 0, 0, $marcaX, $marcaY);
imagedestroy($marca);
header("Content-type: image/png");
imagepng($mini);
imagedestroy($mini);
?>
  Puedes verlo en funcionamiento aquí:  ejemplo...  
Espero que lo entiendas... si lo crees necesario movemos el tema a php.  
Saludos        
				__________________  Por favor: 
No hagan preguntas de temas de foros en mensajes privados... no las respondo           |