Maker PHP Write Words on a Picture
So say I have a picture with some design on it.
I have two red parts on the picture for text generated by the PHP to go there.
So I have a script that Says what month it is. When someone visits the page, the image will pop up and in the red part the PHP will show what month it is.
How can I do this?
Re: Maker PHP Write Words on a Picture
depending on the type of image, you can start by using one of these functions:
then, you can assign a color within this image using the imageColorAllocate() function.
then, you can draw text on the image using either one of these functions (using whatever color you picked in the last step):
- imageTTFText() (note the TTF in the function's name -- that means you'll need to supply a true type font file for this function to use [eg. it has to be located on your server!])
- imageString() (note that external font files can be loaded for this function, but they would be in a different format than TTF)
and finally, you can display it using one of these functions (it'd be best to stick with whichever function coincides with the one you created your image with!):
as always, you can ask questions if you don't understand something.
Re: Maker PHP Write Words on a Picture
Re: Maker PHP Write Words on a Picture
actually imageCreateFrom...
Re: Maker PHP Write Words on a Picture
Quote:
Originally Posted by
kfcSmitty
actually imageCreateFrom...
Balls...
Now I look stupid :afrog:
Re: Maker PHP Write Words on a Picture
whoops, typing fast and copying and pasting. links work, though. you read too much into it! ;)
Re: Maker PHP Write Words on a Picture