Ever hear of this??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bloodxus
Forum Newbie
Posts: 4
Joined: Fri Feb 06, 2004 11:41 pm
Location: USA

Ever hear of this??

Post by bloodxus »

Hello everyone. This is my first post at the forum. I was wondering if there is a script available for adding text to a graphic. I have a free web buttons website and want to provide the visitor an option of adding some text to his/her choice of button. Maybe they could click on the image and be able to add text? I am a newbie at php scripting and want to learn how to do this stuff! Thanks for everyone's time, Jim
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

not hard to do with GD lib, checkout tutorials at http://www.hotscripts.com or u might even find a script for it.
bloodxus
Forum Newbie
Posts: 4
Joined: Fri Feb 06, 2004 11:41 pm
Location: USA

Post by bloodxus »

Thanks, but i already looked there and didn't find anything. Some scripts were close but not really. Have a good day, Jim
dodga
Forum Newbie
Posts: 9
Joined: Sat Feb 07, 2004 2:10 pm
Location: Benztown, Germany

Post by dodga »

Your question is not very specific, so it is hard to give a good/satisfying answer.
A good place to start at is the PHP manuals section about Image functions.

I think you want your users to select an image and then put user customizable text into that image.
It basically boils down to:
- create handle to operate on images via e.g. [php_man]ImageCreateFromJPEG[/php_man]
- allocating colors via [php_man]ImageColorAllocate[/php_man]
- writing text onto the image via [php_man]ImageTTFText[/php_man]
- write the modified image into a file via e.g. [php_man]ImageJPEG[/php_man]
- destroying the handle via [php_man]ImageDestroy[/php_man]

HTH
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

i have made soemthing like that, it loads banners from a folder, user inputs text for the banner and position,color and size of it too, after submit, it putd the text on th location with size and position, but its not quite done yet, if you want it, send me a pm with ur email and i'll send it to ya, then you can make the changes etc.
Post Reply