gd2

i want the text (over a image with gd2 library) with XX% of width and 100%
of height of original ttf (es:verdana.ttf).
that is possibile ??
which is an alternative php extension for resolve this problem ?

thanks

Elvis C.
info[at]elvisciotti.it
vis [ Mi, 07 Februar 2007 01:54 ] [ ID #1621850 ]

Re: gd2

vis <info [at] elvisciotti.it> wrote:

> i want the text (over a image with gd2 library) with XX% of width and
> 100%
> of height of original ttf (es:verdana.ttf).
> that is possibile ??

1. Check the dimensions with imagettftbox()
2. Create an image of that proportions.
3. Make it transparent using imagecolorallocatealpha().
4. Create the text using imagettftext();
6. Copy the created image over the image you want the text in using
imagecopyresampled(), with which you can also change the dimensions/size
of the (part of the) image pasted in.

> which is an alternative php extension for resolve this problem ?

Maybe imagemagick can do the same, haven't checked on it though.
--
Rik Wasmus
Rik [ Mi, 07 Februar 2007 02:23 ] [ ID #1621851 ]

Re: gd2

"vis" <info [at] elvisciotti.it> wrote in message
news:45c92382$0$31672$4fafbaef [at] reader1.news.tin.it...
|i want the text (over a image with gd2 library) with XX% of width and 100%
| of height of original ttf (es:verdana.ttf).
| that is possibile ??
| which is an alternative php extension for resolve this problem ?

it is possible and gd2 lib is the best tool for the job. is there a reason
you're asking about others?
Steve [ Mi, 07 Februar 2007 02:20 ] [ ID #1621859 ]
PHP » alt.php » gd2

Vorheriges Thema: FUSK!
Nächstes Thema: I'm Starting To Think It's Just Not Possible.