Add Bitmap to Sprite : Bitmap : Graphics Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Graphics » Bitmap »

 

Add Bitmap to Sprite


 
package{
  import flash.display.Sprite;
  import flash.display.*;
      import flash.geom.*;
  public class Main extends Sprite{
    public function Main(){

        var imgData:BitmapData = new BitmapData(2020, false, 0xFF00FF00);
        imgData.fillRect(new Rectangle(551010)0xFF0000FF);
        
        var bmp1:Bitmap = new Bitmap(imgData);
        addChild(bmp1);
        
        var bmp2:Bitmap = new Bitmap(imgData);
        bmp2.rotation = 45;
        bmp2.x = 50;
        bmp2.scaleX = 2;  // 200%
        bmp2.scaleY = 2;  // 200%
        addChild(bmp2);
    }
  }
}

        



Leave a Comment / Note


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


Flash / Flex / ActionScript examples

 Navioo Graphics
» Bitmap