包 | flash.filters |
类 | public class BitmapFilter |
继承 | BitmapFilter Object |
子类 | BevelFilter, BlurFilter, ColorMatrixFilter, ConvolutionFilter, DisplacementMapFilter, DropShadowFilter, GlowFilter, GradientBevelFilter, GradientGlowFilter, ShaderFilter |
语言版本: | ActionScript 3.0 |
运行时版本: | AIR 1.0 Flash Player 9 |
BevelFilter、BlurFilter、ColorMatrixFilter、ConvolutionFilter、DisplacementMapFilter、DropShadowFilter、GlowFilter、GradientBevelFilter 和 GradientGlowFilter 类都扩展了 BitmapFilter 类。您可以将这些滤镜效果应用于任何显示对象。
不可以直接实例化或扩展 BitmapFilter。
方法 | 定义方 | ||
---|---|---|---|
返回 BitmapFilter 对象,它是与原始 BitmapFilter 对象完全相同的副本。 | BitmapFilter | ||
指示对象是否已经定义了指定的属性。 | Object | ||
指示 Object 类的实例是否在指定为参数的对象的原型链中。 | Object | ||
指示指定的属性是否存在、是否可枚举。 | Object | ||
设置循环操作动态属性的可用性。 | Object | ||
返回指定对象的字符串表示形式。 | Object | ||
返回指定对象的原始值。 | Object |
clone | () | 方法 |
public function clone():BitmapFilter
语言版本: | ActionScript 3.0 |
运行时版本: | AIR 1.0 Flash Player 9 |
返回 BitmapFilter 对象,它是与原始 BitmapFilter 对象完全相同的副本。
返回BitmapFilter — 一个 BitmapFilter 对象。 |
filters
属性进行跟踪。
package { import flash.display.Sprite; import flash.filters.*; public class BitmapFilterExample extends Sprite { public function BitmapFilterExample() { trace(this.filters.length); // 0 var tmpFilters:Array = this.filters; tmpFilters.push(FilterFactory.createFilter(FilterFactory.BEVEL_FILTER)); tmpFilters.push(FilterFactory.createFilter(FilterFactory.GLOW_FILTER)); this.filters = tmpFilters; trace(this.filters.length); // 2 trace(this.filters[0] is BitmapFilter); // true trace(this.filters[0] is BevelFilter); // true trace(this.filters[1] is BitmapFilter); // true trace(this.filters[1] is GlowFilter); // true } } } import flash.filters.*; class FilterFactory { public static var BEVEL_FILTER:String = "BevelFilter"; public static var BevelFilterConstructor:Class = BevelFilter; public static var BLUR_FILTER:String = "BlurFilter"; public static var BlurFilterConstructor:Class = BlurFilter; public static var COLOR_MATRIX_FILTER:String = "ColorMatrixFilter"; public static var ColorMatrixFilterConstructor:Class = ColorMatrixFilter; public static var CONVOLUTION_FILTER:String = "ConvolutionFilter"; public static var ConvolutionFilterConstructor:Class = ConvolutionFilter; public static var DISPLACEMENT_MAP_FILTER:String = "DisplacementMapFilter"; public static var DisplacementMapFilterConstructor:Class = DisplacementMapFilter; public static var DROP_SHADOW_FILTER:String = "DropShadowFilter"; public static var DropShadowFilterConstructor:Class = DropShadowFilter; public static var GLOW_FILTER:String = "GlowFilter"; public static var GlowFilterConstructor:Class = GlowFilter; public static var GRADIENT_BEVEL_FILTER:String = "GradientBevelFilter"; public static var GradientBevelFilterConstructor:Class = GradientBevelFilter; public static var GRADIENT_GLOW_FILTER:String = "GradientGlowFilter"; public static var GradientGlowFilterConstructor:Class = GradientGlowFilter; public static function createFilter(type:String):BitmapFilter { return new FilterFactory[type + "Constructor"](); } }