
BitmapData (flash.display.BitmapData)
297
applyFilter (BitmapData.applyFilter method)
public applyFilter(sourceBitmap:BitmapData, sourceRect:Rectangle,
destPoint:Point, filter:BitmapFilter) : Number
Takes a source image and a filter object and generates the filtered image.
This method relies on the behavior of built-in filter objects, which have code to determine the
destination rectangle that is affected by an input source rectangle.
After a filter is applied, the resulting image can be larger than the input image. For example, if
you use a BlurFilter class to blur a source rectangle of (50,50,100,100) and a destination point
of (10,10), the area that changes in the destination image is larger than (10,10,60,60) because
of the blurring. This happens internally during the
applyFilter()
call.
If the
sourceRect
parameter of the
sourceBitmapData
parameter is an interior region, such
as (50,50,100,100) in a 200 x 200 image, the filter uses the source pixels outside the
sourceRect
parameter to generate the destination rectangle.
Availability:
ActionScript 1.0; Flash Player 8
Parameters
sourceBitmap
:flash.display.BitmapData
- The input bitmap image to use. The source
image can be a different BitmapData object or it can refer to the current BitmapData
instance.
sourceRect
:flash.geom.Rectangle
- A rectangle that defines the area of the source image
to use as input.
destPoint
:flash.geom.Point
- The point within the destination image (the current
BitmapData instance) that corresponds to the upper-left corner of the source rectangle.
filter
:flash.filters.BitmapFilter
- The filter object that you use to perform the
filtering operation. Each type of filter has certain requirements, as follows:
■
BlurFilter
— This filter can use source and destination images that are either opaque or
transparent. If the formats of the images do not match, the copy of the source image that
is made during the filtering matches the format of the destination image.
■
BevelFilter, DropShadowFilter, GlowFilter
— The destination image of these filters must
be a transparent image. Calling DropShadowFilter or GlowFilter creates an image that
contains the alpha channel data of the drop shadow or glow. It does not create the drop
shadow onto the destination image. If you use any of these filters with an opaque
destination image, an error code value of -6 is returned.
■
ConvolutionFilter
— This filter can use source and destination images that are either
opaque or transparent.
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...