Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

swfshape.addfill(3) [php man page]

SWFSHAPE.ADDFILL(3)							 1						       SWFSHAPE.ADDFILL(3)

SWFShape::addFill - Adds a solid fill to the shape

SYNOPSIS
SWFFill SWFShape::addFill (int $red, int $green, int $blue, [int $alpha = 255]) DESCRIPTION
SWFFill addFill (SWFBitmap $bitmap, [int $flags]) SWFFill addFill (SWFGradient $gradient, [int $flags]) Warning This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk. SWFShape.addFill(3) adds a solid fill to the shape's list of fill styles. SWFShape.addFill(3) accepts three different types of arguments. $red, $green, $blue is a color (RGB mode). The $bitmap argument is an SWFBitmap(3) object. The $flags argument can be one of the following values: SWFFILL_CLIPPED_BITMAP, SWF- FILL_TILED_BITMAP, SWFFILL_LINEAR_GRADIENT or SWFFILL_RADIAL_GRADIENT. Default is SWFFILL_TILED_BITMAP for SWFBitmap and SWFFILL_LIN- EAR_GRADIENT for SWFGradient. The $gradient argument is an SWFGradient(3) object. The flags argument can be one of the following values : SWFFILL_RADIAL_GRADIENT or SWFFILL_LINEAR_GRADIENT. Default is SWFFILL_LINEAR_GRADIENT. I'm sure about this one. Really. SWFShape.addFill(3) returns an SWFFill(3) object for use with the SWFShape.setLeftFill(3) and SWFShape.setRightFill(3) functions described below. EXAMPLES
This simple example will draw a frame on a bitmap. Ah, here's another buglet in the flash player- it doesn't seem to care about the second shape's bitmap's transformation in a morph. According to spec, the bitmap should stretch along with the shape in this example.. Example #1 SWFShape.addFill(3) example <?php $p = new SWFMorph(); $b = new SWFBitmap(file_get_contents("alphafill.jpg")); // use your own bitmap $width = $b->getWidth(); $height = $b->getHeight(); $s = $p->getShape1(); $f = $s->addFill($b, SWFFILL_TILED_BITMAP); $f->moveTo(-$width/2, -$height/4); $f->scaleTo(1.0, 0.5); $s->setLeftFill($f); $s->movePenTo(-$width/2, -$height/4); $s->drawLine($width, 0); $s->drawLine(0, $height/2); $s->drawLine(-$width, 0); $s->drawLine(0, -$height/2); $s = $p->getShape2(); $f = $s->addFill($b, SWFFILL_TILED_BITMAP); // these two have no effect! $f->moveTo(-$width/4, -$height/2); $f->scaleTo(0.5, 1.0); $s->setLeftFill($f); $s->movePenTo(-$width/4, -$height/2); $s->drawLine($width/2, 0); $s->drawLine(0, $height); $s->drawLine(-$width/2, 0); $s->drawLine(0, -$height); $m = new SWFMovie(); $m->setDimension($width, $height); $i = $m->add($p); $i->moveTo($width/2, $height/2); for ($n=0; $n<1.001; $n+=0.03) { $i->setRatio($n); $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); $m->output(); ?> SEE ALSO
SWFShape.setLeftFill(3), SWFShape.setRightFill(3). PHP Documentation Group SWFSHAPE.ADDFILL(3)

Check Out this Related Man Page

.::SWF::Bitmap(3pm)					User Contributed Perl Documentation				       .::SWF::Bitmap(3pm)

NAME
SWF::Bitmap - Bitmap class SYNOPSIS
use SWF::Bitmap; $bitmap = new SWF::Bitmap('filename'); $fill = $shape->addBitmapFill($bitmap); DESCRIPTION
SWF::Bitmap enables you to add JPG, PNG, GIF and DBL files. It is a helper class most useful for filling shapes (i.e. SWF::Shape objects). DBL files ('Define Bitmap Lossless') may be produced from PNG or GIF files by using png2dbl or gif2dbl tools. METHODS
$bitmap = new SWF::Bitmap($filename, [$alpha]) Creates a new SWF::Bitmap object using 'filename'. The alpha parameter represents a filename for opacity data ('alpha' channel), but only for JPG files. Alpha data files are produced by tool gif2mask. The original GIF used for gif2mask input file containing alpha information should have same dimensions (width x height) as the JPG file. $bitmap = newBitmapFromFileHandle($filehandle) Creates a new SWF::Bitmap object using an open file handle $filehandle . This way you could use STDIN, piped data etc. etc. for input. A simple example: open (PICT,'flowers.jpg') or die; $bmp = newBitmapFromFileHandle SWF::Bitmap(PICT); # ..... $m->save("my_flowers.swf"); close (PICT); # Please note: do not close the PICT file too early. $bitmap = newSWFDBLBitmap SWF::Bitmap($filename) Creates a new SWF::Bitmap object using DBL file. Use this constructor if you have a file with DBL data, but not with .dbl filename extension. $bitmap = newSWFJpegBitmap SWF::Bitmap($filename) Creates a new SWF::Bitmap object using JPG file. Use this constructor if you have a file with JPG data, but not with .jpg or .jpeg filename extension. $bitmap = newSWFJpegWithAlpha SWF::Bitmap($filename,$alpha_filename) Creates a new SWF::Bitmap object using JPG file similar newSWFJpegBitmap() with additional opacity information in 'alpha' file. Use this constructor if you have a file with JPG data, but not with .jpg or .jpeg filename extension and if there is opacity information available in 'alpha_filename' file. Alpha data files are produced by gif2mask tool. The original GIF file containing alpha information used for gif2mask input should have same dimensions as the JPG file. $width = $bitmap->getWidth(); Returns width of bitmap in pixels. $height = $bitmap->getHeight(); Returns height of bitmap in pixels. AUTHOR
Soheil Seyfaie (soheil@netcom.ca), Albrecht Kleine and developers of ming.sourceforge.net SEE ALSO
SWF, SWF::Fill, SWF::Shape, SWF::Button, SWF::Constants, png2dbl, gif2dbl, gif2mask perl v5.14.2 2011-10-26 .::SWF::Bitmap(3pm)
Man Page