matrix[0]、matrix[6]、matrix[12] 值皆為1時,Bitmap物件為原值,圖形不變。
package { import flash.display.Sprite; import flash.filters.ColorMatrixFilter; import flash.display.BitmapData; import flash.display.Bitmap; import flash.display.DisplayObject; // public class ColorMF_identity_991221 extends Sprite{ public var bmd:BitmapData = new MyPhoto(0,0); public var bm:Bitmap = new Bitmap(bmd); public function ColorMF_identity_991221() { addChild(bm); var matrix:Array = new Array(); matrix = matrix.concat([1, 0, 0, 0, 0]); //RED Channel matrix = matrix.concat([0, 1, 0, 0, 0]); //GREEN Channel matrix = matrix.concat([0, 0, 1, 0, 0]); //BLUE Channel matrix = matrix.concat([0, 0, 0, 1, 0]); //ALPHA Channel var myFilter:ColorMatrixFilter = new ColorMatrixFilter(matrix); bm.filters = [myFilter]; } } }
沒有留言:
張貼留言