Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

11. Animations and Effects > 11.10. Use the Convolution Filter to Create an Ani...

11.10. Use the Convolution Filter to Create an Animation

Problem

You want to create an Animation to use on a MXML component that uses a ConvolutionFilter.

Solution

Create an AnimationInstance class that instantiates new ConvolutionFilter instances in the animationUpdate() event handler and then assign those ConvolutionFilter instances to the target DisplayObject filters array.

Discussion

A ConvolutionFilter alters its target DisplayObject or BitmapImage in a very flexible manner, allowing the creation of effects such as blurring, edge detection, sharpening, embossing, and beveling. Each pixel in the source image is altered according to the values of its surrounding pixels. The alteration to each pixel is determined by the Matrix array passed into a ConvolutionFilter in its constructor. The ConvolutionFilter constructor has the following signature:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint