Image::Button::Rect - Builds rectangular PNG buttons
use Image::Button::Rect; my $b1 = new Image::Button::Rect(text => 'text b1', font => 'newsgotn.ttf', fontsize => 20, file => 'b1.png'); $b1->print;
Builds reasonably good looking rectangular buttons, with shadows and all, using GD with TrueType support. See Image::Button for more details about things you can do with Buttons.
my $b = new Image::Button::Rect(text => 'text', font => 'newsgotn.ttf', fontsize => 20, file => 'file.png');
The arguments are
Defaults to ''.
The TrueType font with which to print. It should be located either in the current directory or in the directory pointed at by the environment variable TTFONTS. Mandatory.
Font size. Defaults to 12 points.
File where the button will be saved. Can be overridden in the print function. Mandatory if you plan to use Image::Button::Set to output several related buttons at a time. Defaults to the button text, replacing spaces by '-'. Use '>-' if you want to send the image to standard output.
Button color in RGB (so [255,255,255] is white and [0,0,0] is black). Defaults to [238,238,204], which is as nice a color as any other.
Foreground (text) color in RGB. Defaults to [0,0,0].
Background color in RGB. This is the color you want to be equal to your page background. Defaults to [255,255,255]. You might want to set this transparent, but (1) it's not implemented---in Button.pm, GD knows how to do it--- and (2) IE, or at least some versions of it, doesn't handle transparent PNGs correctly.
Vertical margin under and over the text, more or less. Defaults to 4 pixels.
Horizontal margin left and right of the text, more or less. Defaults to 4 pixels.
Image::Button for a description of how to make buttons, and other functions you can use with Image::Button::Rect.
Image::Button::Set for building sets of related buttons.
Juan M. García-Reyero <joanmg@twostones.org>
Copyright (C) 2003 Juan M. García-Reyero. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'García-Reyero'. Assuming CP1252
To install Image::Button, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Image::Button
CPAN shell
perl -MCPAN -e shell install Image::Button
For more information on module installation, please visit the detailed CPAN module installation guide.