Todd,

I'm not sure if you can write text to an existing image as I add to a new
one but here is the code I use...

$updateTime = date("F d, Y - h:ia");
$text = "New Movie Reviews @hyrum.net ".$updateTime;

$image = ImageCreate(500, 70);
$bg = ImageColorAllocate($image, 255, 255, 255);
$blue = ImageColorAllocate($image, 0, 0, 255);
$black = ImageColorAllocate($image, 0, 0, 0);
$himage=
ImageCreateFromPNG("/home/hyrum/public_html/images/topics/hyrum.png");
ImageRectangle($image, 0, 0, 500, 70, $white);
ImageCopy($image, $himage, 410, 5, 1, 1, 89, 64);
ImageString($image, 4, 0, 0, $text, $blue);
ImageString($image, 3, 0, 20, $title1, $black);
ImageString($image, 3, 0, 35, $title2, $black);
ImageString($image, 3, 0, 50, $title3, $black);


ImagePNG($image, "signature.png");
ImageDestroy($image);

So you could create a new image and copy your jpg to the new canvas or (and
preferably) someone will know if you can add text to an already existing
image...

Jeff

> -----Original Message-----
> From: Todd Cary [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 04, 2001 6:30 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Best way to put text on image
>
>
> If I have a JPEG image, what is the best way to put text or another
> image at a certain place using the gd library?
>
> Todd
>
> --
> Todd Cary
> Ariste Software
> [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to