x
Loading
 Loading
Hello, Guest | Login | Register

Who’s Got the Button?

Who has time to make those cute little graphic buttons for their Web site — especially when you’re rede- signing it and are changing the text(or, perhaps the text varies sometimes)? Well, I was faced with that issue the other day while contemplating Yet Another Redesign for my Web site at perltraining.stonehenge. com. I wanted to include some “next” and “previous” buttons, but didn’t want to spend a lot of time in some bitmap-drawing program coming up with them.

Who has time to make those cute little graphic buttons for their Web site — especially when you’re rede- signing it and are changing the text(or, perhaps the text varies sometimes)? Well, I was faced with that issue the other day while contemplating Yet Another Redesign for my Web site at perltraining.stonehenge. com. I wanted to include some “next” and “previous” buttons, but didn’t want to spend a lot of time in some bitmap-drawing program coming up with them.

I’ve tackled a task similar to this before using the GD library, but it was just for the rounded corners of table-ish buttons. This time, I was much more ambitious; I wanted to go whole hog and do the entire thing as a single graphic, so that the ALT text would be properly replaced on a non-graphical browser.

GD’s font capabilities never really impressed me, so I turned (with great hesitation) to the ImageMagick library and its PerlMagick binding. I believe I know where the “Magick” part of the library gets its name; when you finally figure out how to do what you want, it appears to be “magick,” since the documentation is mostly absent.

So, after invoking the convert command about 200 to 300 times, slowly varying the parameters, trying new things, and then trying to figure out how to convert that to the Perl bindings, invoking it again some 200 or so times (I’m really not joking about these numbers but wish I were), I came…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Helpful Tools for Software Developers
  2. The Github Hall of Fame
  3. Book'em, Github.
  4. This Week on Github: Stupid Ruby Tricks
  5. A Veritable Scatter Shot!
Follow Linux Magazine
Rackspace