How draw( ) handles Alpha channel values : BitmapData : Graphics Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Graphics » BitmapData »

 

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(2020, true, 0xFFFF0000);
        var blueSquare:BitmapData = new BitmapData(2020, true, 0xFF0000FF);
        
        var sourceRect:Rectangle = new Rectangle(55105);
        
        var destPoint:Point = new Point(0,0);
        
        redSquare.copyPixels(blueSquare, sourceRect, destPoint);
        
        var b:Bitmap = new Bitmap(redSquare);
        addChild(b);

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Graphics
» BitmapData