SWF::Builder::Character::Bitmap - SWF Bitmap object
my $jpeg = $mc->new_jpeg( 'picture.jpg' ); $jpeg->place; use GD; $gd = GD::Image->newFromPng( 'tile.png' ); my $bm = $mc->new_bitmap( $gd, 'GD' ); my $shape = $mc->new_shape ->fillstyle($bm, 'tiled', $bm->matrix) ->box(0, 0, 100, 100);
SWF supports JPEG and lossless bitmaps.
returns a new JPEG bitmap. It can take named parameters as follows:
set a JPEG Data from a file and a binary data string, respectively.
set an alpha (transparency) data from a file, a binary data string, and a single byte, respectively. The alpha data is width x height length string of byte, 0(transparent) to 255(opaque). A single byte Alpha is expanded into the proper size.
When you give a single parameter, it is regarded as the JPEG file name. Same as JPEGFile => $filename.
set a JPEG/Alpha data.
load a JPEG/alpha data file.
returns a new lossless bitmap converted from a $type of $obj. If $type is omitted, it is guessed. If $obj is not an object, it is treated as a file name.
Acceptable types are as follows:
takes a GD::Image object.
takes an Image::Magick object.
takes an array reference of [ $width, $height, $colors, $is_alpha, \&pixsub ]. $width and $height are the width and height of the bitmap. $colors is a total number of colors of the bitmap. If it is under 256, the bitmap is converted to colormapped image, otherwise 24-bit full color. $is_alpha is a flag whether the bitmap has an alpha data. &pixsub is a subroutine, which takes pixel coordinates ($x, $y) and returns an array of the color data of the pixel, ($r, $g, $b, $a).
returns the bitmap width.
returns the bitmap height.
returns the bounding box of the bitmap, (0, 0, width, height).
returns a bitmap transformation matrix.
returns the display instance of the bitmap (to be exact, returns the instance of a box shape which filled with the bitmap). See SWF::Builder.
Copyright 2003 Yasuhiro Sasama (ySas), <ysas@nmt.ne.jp>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install SWF::Builder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SWF::Builder
CPAN shell
perl -MCPAN -e shell install SWF::Builder
For more information on module installation, please visit the detailed CPAN module installation guide.