How draw( ) handles Alpha channel values
package{
import flash.display.*;
import flash.utils.*;
import flash.events.*;
import flash.geom.*;
import flash.text.*;
public class Main extends Sprite{
public function Main(){
var redSquare:BitmapData = new BitmapData(20, 20, true, 0xFFFF0000);
var blueSquare:BitmapData = new BitmapData(20, 20, true, 0xFF0000FF);
var sourceRect:Rectangle = new Rectangle(5, 5, 10, 5);
var destPoint:Point = new Point(0,0);
redSquare.copyPixels(blueSquare, sourceRect, destPoint);
var b:Bitmap = new Bitmap(redSquare);
addChild(b);
}
}
}
Related examples in the same category