GD::Tiler - package to aggregate images into a single tiled image via GD |
GD::Tiler - package to aggregate images into a single tiled image via GD
use GD::Tiler qw(tile); # # use computed coordinates for layout, and retrieve the # coordinates for later use (as imported method) # my ($img, @coords) = tile( Images => [ 'chart1.png', 'chart2.png', 'chart3.png', 'chart4.png'], Background => 'lgray', Center => 1, VEdgeMargin => 10, HEdgeMargin => 10, VTileMargin => 5, HTileMargin => 5); # # use explicit coordinates for layout (as class method) # my $explimg = GD::Tiler->tile( Images => [ 'chart1.png', 'chart2.png', 'chart3.png', 'chart4.png'], Background => 'lgray', Width => 500, Height => 500, Coordinates => [ 10, 10, 120, 10, 10, 120, 120, 120 ]);
Creates a new tiled image from a set of input images. Various arguments may be specified to position individual images, or the default behaviors can be used to create an reasonable placement to fill a square image.
Only a single method is provided:
Returns a GD::Image object of the images specified in %args, positioned according to the directives in %arg. In array context, also returns the list of upper left corner coordinates of each image, so e.g., an application can adjust the image map coordinate values for individual images.
Valid %args are:
$width
(optional)$height
(optional)$format
(optional)\@images
(required)$color
(optional)white lyellow lpurple lbrown lgray yellow purple dbrown gray dyellow dpurple transparent dgray lgreen lorange black green orange lblue dgreen pink blue lred dpink dblue red marine gold dred cyan
Default is white.
$pixels
(optional)$pixels
(optional)$pixels
(optional)$pixels
(optional)$pixels
(optional)$pixels
(optional)\@coords
(optional)If Coordinates is specified, then Height and Width must also be specified, and any margin values are ignored.
$boolean
(optional)$count
(optional)
GD
Dean Arnold mailto:darnold@presicient.com
Copyright(C)
2006, Dean Arnold, Presicient Corp., USA. All rights reserved.
This software may used under the same terms as Perl itself; refer to the Perl Artistic license for details.
GD::Tiler - package to aggregate images into a single tiled image via GD |