merge(sourceBitmapData:BitmapData, sourceRect:Rectangle, destPoint:Point, redMultiplier:uint, greenMultiplier:uint, blueMultiplier:uint, alphaMultiplier:uint):void
執行從來源影像到目標影像的每個色版的混合。
適用於 Adobe Flash Professional CS5 的 ActionScript 3.0 參考__●flash.display.BitmapData.merge()方法
(一)
991213_BitmapData.merge_1.swf
import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; import flash.geom.Point; var bmd1:BitmapData = new BitmapData(100, 80, true, 0xFF00FF00); var bmd2:BitmapData = new BitmapData(100, 80, true, 0xFFFF0000); var rect:Rectangle = new Rectangle(0, 0, 20, 20); var pt:Point = new Point(20, 20); var mult:uint = 0x80; // 50% bmd1.merge(bmd2, rect, pt, mult, mult, mult, mult); var bm1:Bitmap = new Bitmap(bmd1); addChild(bm1); var bm2:Bitmap = new Bitmap(bmd2); addChild(bm2); bm2.x = 110;
(二)
991213_BitmapData.merge_2.swf
import flash.display.BitmapData; import flash.display.Bitmap; import flash.geom.Rectangle; import flash.geom.Point; // var bmd1:BitmapData = new MyPhoto1(0, 0); var bmd2:BitmapData = new MyPhoto2(0, 0); // var rect:Rectangle = new Rectangle(100, 100, 450, 300); var pt:Point = new Point(50, 50); var multiplier:uint = 0x80; // bmd1.merge(bmd2, rect, pt, 0xf0, 0xa0, 0x20, 0x30); // var bm1:Bitmap = new Bitmap(bmd1); bm1.x = 0; bm1.y = 0; /* var bm2:Bitmap = new Bitmap(bmd2); bm2.x = 0; bm2.y = 0; */ // addChild(bm1); //addChild(bm2);
沒有留言:
張貼留言