Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/11/2007, 16:32
Avatar de dopon
dopon
 
Fecha de Ingreso: julio-2005
Ubicación: Cucuta / Colombia
Mensajes: 493
Antigüedad: 21 años, 3 meses
Puntos: 1
Re: unir dos ficheros PHP

si te entendi bien creo que lo que deseas e sun codigo que se vea mas o menos asi :

Código PHP:
<?php
$path 
= "foto.jpg";
$image = imagecreatefromstring(file_get_contents($path));

$w = imagesx($image);
$h = imagesy($image);

$watermark = imagecreatefrompng('watermark.png');
$ww = imagesx($watermark);
$wh = imagesy($watermark);

imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh);

/* Punto de Union */

$color = ImageColorAllocate($image,0,0,0);
$width_image = ImageSX($image);
$width_text = 300;
$text = "texto";
$font = "font.ttf";
$font_size = 12;
$bbox = imagettfbbox($font_size,0,$font,$text);
$right_text = $bbox[2];
$left_text = $bbox[0];
$height_text = $bbox[7];
ImageTTFText($image,$font_size,0,10,10,$color,$font,$text);
Header ("Content-type: image/jpeg");
ImageJpeg ($image);
ImageDestroy($image); 
?>
en el script escribir.php reemplaze $im por $image para unirlos completamente