Differences between revisions 1 and 2
Revision 1 as of 2008-09-01 09:45:44
Size: 823
Editor: klaus
Comment:
Revision 2 as of 2008-09-06 12:02:55
Size: 1088
Editor: klaus
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
           int passes /* number of passes. shoub be <= 3 */)            int passes /* number of passes. should be <= 3 */)
Line 13: Line 13:

This filter is based on a "box filter", which is a simple median pixel filter. See http://en.wikipedia.org/wiki/Box_blur for more details.

If passes is set to 3, it is a approximation of a Gaussian filter.

For performance reasons, passses should be <= 3.

C

SWFFilter 
newBlurFilter(SWFBlur blur /* blur */)


SWFBlur 
newSWFBlur(float blurX /* horiz. blur amount */, 
           float blurY /* vert. blur amount */, 
           int passes /* number of passes. should be <= 3 */)

This filter is based on a "box filter", which is a simple median pixel filter. See http://en.wikipedia.org/wiki/Box_blur for more details.

If passes is set to 3, it is a approximation of a Gaussian filter.

For performance reasons, passses should be <= 3.

Example

/*
...
*/

SWFBlur blur;
SWFFilter f;

blur = newSWFBlur(5,5,2);
f = newBlurFilter(blur);

/*
...
*/

// attach filter to DisplayItem
// display item must be a MovieClip, Button or TextField instance
SWFDisplayItem_addFilter(item, f);

/* ... */

PHP

/*
...
*/
$bl = new SWFBlur(5, 5, 2);
$f = new SWFFilter(SWFFILTER_TYPE_BLUR, $bl);

$bu = new SWFButton();
$bu->addShape($s, SWFBUTTON_UP | SWFBUTTON_HIT | SWFBUTTON_OVER | SWFBUTTON_DOWN);
$item = $m->add($bu);
$item->addFilter($f);
/*
...
*/

libming: BlurFilter (last edited 2009-06-25 03:09:39 by localhost)