You are here: Re: Centering text in a dynamically created image (GD or ImageMagick). « PHP Programming Language « IT news, forums, messages
Re: Centering text in a dynamically created image (GD or ImageMagick).

Posted by -Lost on 06/07/07 17:24

-Lost wrote:
> gbbulldog wrote:
>> On 6 Jun, 05:34, -Lost <maventheextrawo...@techie.com> wrote:
>>> Anyone know offhand how to center a text within the bounding box of an
>>> image (width-wise at least) without the Freetype library?
>>>
>>> GD- or ImageMagick-specifc code would do nicely.
>>>
>> 1. Determine the width of the image.
>> 2. Determine the width of the text, (I'm assuming you'll be outputting
>> text using TTF?), using imagettfbbox()
>> 3. The left-hand position of the text should be : (image's width / 2)
>> - (text width / 2)
>
> Thanks!

Ooops! I have no clue why I said thanks.

I specifically said "without the Freetype library."

That function depends on its functionality to work as expected.

Thanks though.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация