SWF-File
view release on metacpan or search on metacpan
samples/img2swf.plx view on Meta::CPAN
#!/usr/bin/perl
use strict;
use SWF::File;
use SWF::Element;
use Image::Magick;
use Compress::Zlib;
use Getopt::Std;
my %opt;
getopts('ft', \%opt);
my ($imagefile, $swffile) = @ARGV;
unless (defined $imagefile) {
print STDERR <<USAGE;
samples/img2swf.plx view on Meta::CPAN
perl img2swf.plx [-f] [-t] imagefile [swffile]
-f: Force to convert to full color bitmap.
-t: Keep transparency.
USAGE
exit(1);
}
($swffile = $imagefile) =~s/\.[^.]+$/.swf/ unless defined $swffile;
my $image = Image::Magick->new;
$image->Read($imagefile);
my $height = $image->Get('height');
my $width = $image->Get('width');
die "Can't open $imagefile." if ($height == 0 and $width == 0);
my ($lossless, $tp);
if ($opt{t} and $image->Get('matte')) {
$lossless = SWF::Element::Tag::DefineBitsLossless2->new;
$tp=1;
samples/readme.txt view on Meta::CPAN
SWF::File samples.
sample.plx - create a sample movie. Two rotating rectangles.
jpg2swf.plx - convert JPEG to SWF using DefineBitsJPEG2.
img2swf.plx - convert a bitmap to SWF using DefineBitsLossless/2.
(Image::Magick is needed)
linkext.plx - extract URL referred by 'getURL' action.
( run in 1.289 second using v1.01-cache-2.11-cpan-beeb90c9504 )