For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > May 2006 > Image Create









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Image Create
Hugh Janus

2006-05-16, 3:58 am

Hey there,
I have a image I created, and would like to get somethings from the database
then it compiles together as a new image.

Here are some examples,
http://tsviewer.hfd.de/promotion/dy...an_all/1910.png
http://www.flyukva.com/flyuk//pilot...ges/UKV1123.png

any help is very much appriciated


Martin Jay

2006-05-16, 3:58 am

In message <44697f71$1@news01.wxnz.net>, Hugh Janus
<hugh_janus@bigfoot.com> writes
>Hey there,
>I have a image I created, and would like to get somethings from the database
>then it compiles together as a new image.
>
>Here are some examples,
>http://tsviewer.hfd.de/promotion/dy...an_all/1910.png
>http://www.flyukva.com/flyuk//pilot...ges/UKV1123.png
>
>any help is very much appriciated


There are examples of how to add text to an image in the PHP manual, see
<http://uk.php.net/manual/en/function.imagettftext.php>.

One thing to remember is that you will need to have a copy of the font
you wish to you on your server.
--
Martin Jay
Hugh Janus

2006-05-16, 3:58 am

Cheers for that, just trying to work out how to place the text where I want
it, do you know how??


Martin Jay

2006-05-16, 7:57 am

In message <446988aa@news01.wxnz.net>, Hugh Janus
<hugh_janus@bigfoot.com> writes
>Cheers for that, just trying to work out how to place the text where I want
>it, do you know how??


It's used like this:

imagettftext($img, $size, $angle, $x, $y, $colour, $font, $text);

$x and $y are the location of the text on the image in pixels, where
$x=0 and $y=0 is the bottom left corner of the image.

In the past I've just used a bit of trial and error to position the text
where I want it in the image.
--
Martin Jay
Hugh Janus

2006-05-17, 3:58 am

Cool, got it working, thanks for help

"Martin Jay" <martin@spam-free.org.uk> wrote in message
news:IBN+0LCJNcaEFwbD@spam-free.org.uk...
> In message <446988aa@news01.wxnz.net>, Hugh Janus <hugh_janus@bigfoot.com>
> writes
>
> It's used like this:
>
> imagettftext($img, $size, $angle, $x, $y, $colour, $font, $text);
>
> $x and $y are the location of the text on the image in pixels, where $x=0
> and $y=0 is the bottom left corner of the image.
>
> In the past I've just used a bit of trial and error to position the text
> where I want it in the image.
> --
> Martin Jay



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com