+ Reply to Thread
Results 1 to 4 of 4

Thread: creating button images

  1. #1
    miocene2 is offline x10Hosting Member miocene2 is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    15

    creating button images

    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.

  2. #2
    zapzack is offline x10 Elder zapzack is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    606

    Re: creating button images

    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..

  3. #3
    miocene2 is offline x10Hosting Member miocene2 is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    15

    Re: creating button images

    Quote Originally Posted by zapzack View Post
    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.

  4. #4
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: creating button images

    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 by Scoochi2; 07-30-2009 at 07:01 PM.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

+ Reply to Thread

Similar Threads

  1. Can't See Images
    By rhyeen in forum Programming Help
    Replies: 2
    Last Post: 05-24-2009, 06:57 PM
  2. How to store images in a MySQL database
    By tstivers in forum Tutorials
    Replies: 10
    Last Post: 10-16-2008, 01:11 PM
  3. Flash button for 50 Credits:
    By satheesh in forum The Marketplace
    Replies: 4
    Last Post: 01-25-2008, 08:43 AM
  4. How to protect images without htaccess using PHP
    By frznmnky in forum Tutorials
    Replies: 0
    Last Post: 12-26-2007, 11:51 AM
  5. Firefox 'Back' Button Problems
    By GG-Xtreme in forum Off Topic
    Replies: 3
    Last Post: 12-14-2007, 10:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers