AS2.0 advanced filter code and summary
// Subject sentence
Import fl. awt. img. filter .*;
Import flash. display. BitmapData;
// Filter writing method:
/* Style of relief filter, ReliefFilter (relief direction, relief strength)
Var lvjing = new ReliefFilter (1, 10 );
Var filterArray: Array = new Array ();
FilterArray. push (lvjing );
Pic. filters = filterArray */
/* The channel selects the filter method. ChannelChangeFilter (1 red | 2 green | 4 blue, whether to split the channel) 8 represents channel alpha
Var lvjing = new ChannelChangeFilter (1 | 2 | 8, false );
Var filterArray: Array = new Array ();
FilterArray. push (lvjing );
Pic. filters = filterArray ;*/
/*
// Write the pattern filter, new ClothFilter (myBitmapData, pattern intensity );
// Condition: you need to create BitmapData, preferably equal to or greater than the image.
Stop ()
Var n = 0;
OnEnterFrame = function (){
N ++;
Var myBitmapData: BitmapData = new BitmapData (460,150, true, 0 xCCCCCCCC );
Var lvjing = new ClothFilter (myBitmapData, n );
Var filterArray: Array = new Array ();
FilterArray. push (lvjing );
Pic. filters = filterArray;
If (n & gt; 100 ){
Delete this. onEnterFrame;
}
};
*/
/*
// Invert the color filter ReversesFilter (); no parameter
Var lvjing = new ReversesFilter ();
Pic. filters = [lvjing] */
/*
// Search edge filter method new SearchEdgeFilter (search direction, search intensity)
Var lvjing = new SearchEdgeFilter (2, 8 );
Pic. filters = [lvjing]; */
/*
// Sharpen filter new SharpenFilter (sharpen intensity)
Var lvjing = new SharpenFilter (200 );
Pic. filters = [lvjing]; */
/*
// Diffusion filter. BitmapData, new SplattersFilter (myBitmapData, diffusion width, and diffusion height) is required)
Stop ();
Scalex = 50;
Scaley = 50;
OnEnterFrame = function (){
Scalex --;
Scaley --;
Var myBitmapData: BitmapData = new BitmapData (460,150, true, 0 xCCCCCCCC );
Var lvjing = new SplattersFilter (myBitmapData, scalex, scaley );
Var filterArray: Array = new Array ();
FilterArray. push (lvjing );
Pic. filters = filterArray;
If (scalex = 0 ){
Delete this. onEnterFrame;
}
};
*/
/*
// Watercolor filter new WaterColorFilter (myBitmapData, watercolor width, watercolor height)
Stop ();
Scalex = 50;
Scaley = 50;
OnEnterFrame = function (){
Scalex --;
Scaley --;
Var myBitmapData: BitmapData = new BitmapData (460,150, true, 0 xCCCCCCCC );
Var lvjing = new WaterColorFilter (myBitmapData, scalex, scaley );
Var filterArray: Array = new Array ();
FilterArray. push (lvjing );
Pic. filters = filterArray;
If (scalex = 0 ){
Delete this. onEnterFrame;
}
};*/
/*
// New WaveFilter (myBitmapData, water wave width, water wave height)
Stop ();
Scalex = 50;
Scaley = 50;
OnEnterFrame = function (){
Scalex --;
Scaley --;
Var myBitmapData: BitmapData = new BitmapData (460,150, true, 0 xCCCCCCCC );
Var lvjing = new WaveFilter (myBitmapData, scalex, scaley );
Var filterArray: Array = new Array ();
FilterArray. push (lvjing );
Pic. filters = filterArray;
If (scalex = 0 ){
Delete this. onEnterFrame;
}
};*/
/*
// New WindFilter (myBitmapData, wind speed, or horizontal );
Stop ();
Var speed: Number = 50;
Var shuiping = false;
OnEnterFrame = function (){
Speed --;
Var myBitmapData: BitmapData = new BitmapData (460,150, true, 0 xCCCCCCCC );
Var lvjing = new WindFilter (myBitmapData, speed, shuiping );
Var filterArray: Array = new Array ();
FilterArray. push (lvjing );
Pic. filters = filterArray;
If (speed = 0 ){
Delete this. onEnterFrame;
}
};*/