1.::SWF::Bitmap(3) User Contributed Perl Documentation .::SWF::Bitmap(3)
2
3
4
6 SWF::Bitmap - Bitmap class
7
9 use SWF::Bitmap;
10 $bitmap = new SWF::Bitmap('filename');
11 $fill = $shape->addBitmapFill($bitmap);
12
14 SWF::Bitmap enables you to add JPG, PNG, GIF and DBL files. It is a
15 helper class most useful for filling shapes (i.e. SWF::Shape objects).
16 DBL files ('Define Bitmap Lossless') may be produced from PNG or GIF
17 files by using png2dbl or gif2dbl tools.
18
20 $bitmap = new SWF::Bitmap($filename, [$alpha])
21 Creates a new SWF::Bitmap object using 'filename'. The alpha
22 parameter represents a filename for opacity data ('alpha' channel),
23 but only for JPG files. Alpha data files are produced by tool
24 gif2mask. The original GIF used for gif2mask input file containing
25 alpha information should have same dimensions (width x height) as
26 the JPG file.
27
28 $bitmap = newBitmapFromFileHandle($filehandle)
29 Creates a new SWF::Bitmap object using an open file handle
30 $filehandle . This way you could use STDIN, piped data etc. etc.
31 for input. A simple example:
32
33 open (PICT,'flowers.jpg') or die;
34 $bmp = newBitmapFromFileHandle SWF::Bitmap(PICT);
35 # .....
36 $m->save("my_flowers.swf");
37 close (PICT);
38 # Please note: do not close the PICT file too early.
39
40 $bitmap = newSWFDBLBitmap SWF::Bitmap($filename)
41 Creates a new SWF::Bitmap object using DBL file. Use this
42 constructor if you have a file with DBL data, but not with .dbl
43 filename extension.
44
45 $bitmap = newSWFJpegBitmap SWF::Bitmap($filename)
46 Creates a new SWF::Bitmap object using JPG file. Use this
47 constructor if you have a file with JPG data, but not with .jpg or
48 .jpeg filename extension.
49
50 $bitmap = newSWFJpegWithAlpha SWF::Bitmap($filename,$alpha_filename)
51 Creates a new SWF::Bitmap object using JPG file similar
52 newSWFJpegBitmap() with additional opacity information in 'alpha'
53 file. Use this constructor if you have a file with JPG data, but
54 not with .jpg or .jpeg filename extension and if there is opacity
55 information available in 'alpha_filename' file. Alpha data files
56 are produced by gif2mask tool. The original GIF file containing
57 alpha information used for gif2mask input should have same
58 dimensions as the JPG file.
59
60 $width = $bitmap->getWidth();
61 Returns width of bitmap in pixels.
62
63 $height = $bitmap->getHeight();
64 Returns height of bitmap in pixels.
65
67 Soheil Seyfaie (soheil@netcom.ca), Albrecht Kleine and developers of
68 ming.sourceforge.net
69
71 SWF, SWF::Fill, SWF::Shape, SWF::Button, SWF::Constants, png2dbl,
72 gif2dbl, gif2mask
73
74
75
76perl v5.28.1 2018-11-12 .::SWF::Bitmap(3)