var sp:Sprite=new Sprite();
sp.graphics.beginFill(0xffccdd);
sp.graphics.drawRect(0,0,100,100);
sp.graphics.beginFill(0x33eedd);
sp.graphics.drawRect(100,0,100,100);
addChild(sp);
sp.x=300;
var bmpdt:BitmapData=new BitmapData(200,100);
var bmp:Bitmap=new Bitmap();
//mt 是底板画的操作
var mt:Matrix=new Matrix();
//-100 左移
mt.translate(-100,0);
//rect是指定上面纸的绘制区
var rct:Rectangle=new Rectangle(0,0,100,100);
bmpdt.draw(sp,mt,null,null,rct);
mt.translate(200,0);
rct=new Rectangle(100,0,100,100);
bmpdt.draw(sp,mt,null,null,rct);
bmp.bitmapData=bmpdt;
addChild(bmp);
Bitmap BitmapData,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/naiking/p/3805166.html