Colormatrixfilter (Flash.filters.colormatrixfilter) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

See also
Object
ColorMatrixFilter
(flash.filters.ColorMatrixFilter)
Object
|
+-flash.filters.BitmapFilter
|
+-flash.filters.ColorMatrixFilter
public class ColorMatrixFilter
extends BitmapFilter
The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color
and alpha values of every pixel on the input image to produce a result with a new set of RGBA
color and alpha values. It allows saturation changes, hue rotation, luminance to alpha and
various other effects. You can apply this filter to bitmaps and MovieClip instances.
The use of filters depends on the object to which you apply the filter:
To apply filters to movie clips at runtime, use the
property of an object does not modify the object and can be undone by clearing the
property.
filters
To apply filters to BitmapData instances, use the
Calling
applyFilter()
the filter object and generates a filtered image as a result.
You can also apply filter effects to images and video at authoring time. For more information,
see your authoring documentation.
If you apply a filter to a movie clip or button, the
or button is set to
true
restored.
The following formulas are used, where a[0] through a[19] correspond to entries 0 through
19 in the 20-element array property matrix:
redResult = a[0] * srcR + a[1] * srcG + a[2] * srcB + a[3] * srcA + a[4]
greenResult = a[5] * srcR + a[6] * srcG + a[7] * srcB + a[8] * srcA + a[9]
blueResult = a[10] * srcR + a[11] * srcG + a[12] * srcB + a[13] * srcA +
a[14]
alphaResult = a[15] * srcR + a[16] * srcG + a[17] * srcB + a[18] * srcA +
a[19]
on a BitmapData object takes the source BitmapData object and
. If you clear all filters, the original value of
property. Setting the
filters
BitmapData.applyFilter()
cacheAsBitmap

ColorMatrixFilter (flash.filters.ColorMatrixFilter)

filters
method.
property of the movie clip
is
cacheAsBitmap
423

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF