beginBitmapFill(bitmap:BitmapData, matrix:Matrix = null, repeat:Boolean = true, smooth:Boolean = false):void
以點陣圖影像填滿繪圖區。
apFill_1.swf
//
var bmd:BitmapData = new MyPhoto(0, 0);
//
var myMatrix:Matrix = new Matrix();
//旋轉60度,但需轉換為弧度
var angle:Number = 60*Math.PI/180;
/*with(myMatrix){
//以下四行為旋轉屬性,與使用rotate屬性相同
a = Math.cos(angle);
b = Math.sin(angle);
c = -Math.sin(angle);
d = Math.cos(angle);
}*/
/*以下隱藏為使用Matrix的rotate屬性*/
myMatrix.rotate(60*Math.PI/180);
//
var mySH:Shape = new Shape();
//
var myGH:Graphics = mySH.graphics;
//
with(myGH){
lineStyle(4, 0x000055);
//
beginBitmapFill(bmd, myMatrix, true, true);
//
drawRect(0, 0, 600, 600);
endFill()
}
//
mySH.x = 0;
mySH.y = 0;
//
addChild(mySH);


沒有留言:
張貼留言