creating button images

miocene2

New Member
Messages
15
Reaction score
0
Points
0
I have noticed during trying out wordpress that some themes create the button images for the menu bar using some sort of script. Probably php.

(view my wordpress test to see what I mean)

How would one make such a script to create these kind of buttons? cos it would save going into photoshop and making 3 button images for every button.
 

zapzack

New Member
Messages
606
Reaction score
19
Points
0
just make a div and using CSS, make the background an image button. Then inside each div you can put button text.. This can all be done with CSS..
 

miocene2

New Member
Messages
15
Reaction score
0
Points
0
just make a div and using CSS, make the background an image button. Then inside each div you can put button text.. This can all be done with CSS..

Yes I know that, and that's the way I normally do it.

What I'm after is a script that can generate the image itself.
Probably give the script small images for the left and right of the button and another small image for the center that can be repeat-x'd for the length of the button.

Then you give the script the text with which to put in the generated image and the script generates the button images.

This would allow one to quickly add and change button names without have to go into photoshop and edit the images manually.
 

Scoochi2

New Member
Messages
185
Reaction score
0
Points
0
PHP can do this using GD functions.
http://uk3.php.net/manual/en/book.image.php
The main ones you will probably want to concentrate on are:
imagecreatefrompng (or jpg/gif/gd etc isntead of png - or just imagecreate to start from scratch)
imagecopy (to add the small images on left/right)
imagestring (draw string)
imagepng (output)

Of course, look through the list of functions on the above link and see what to do to get what you want.
 
Last edited:
Top