BitmapData, Matrix2
♥0 |
Line 22 |
Modified 2010-02-02 13:16:49 |
MIT License
archived:2017-03-20 15:10:47
ActionScript3 source code
/**
* Copyright hacker_yk666qry ( http://wonderfl.net/user/hacker_yk666qry )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/3p5E
*/
package {
import flash.geom.Matrix;
import flash.display.Bitmap;
import flash.display.BitmapData;
import flash.display.Sprite;
public class FlashTest extends Sprite {
public function FlashTest() {
// write as3 code here..
var sprite:Sprite = new Sprite();
with( sprite.graphics) {
beginFill(0x000000);
drawRect(0,0,100,100);
endFill();
}
// sprite.scaleX = sprite.scaleY = 3;
// transparent:Boolean (default = true)
//ビットマップイメージがピクセル単位の透明度をサポートするかどうかを指定します。
//デフォルト値は true です (透明) 。完全に透明なビットマップを作成するには、
//transparent パラメータの値を true に、fillColor パラメータの値を 0x00000000 (または 0) に設定します。
//transparent プロパティを false に設定すると、
//レンダリングのパフォーマンスが若干向上することがあります。
var bmd:BitmapData = new BitmapData(sprite.width * 3, sprite.height * 4, false, 0x000000ff);
var matrix:Matrix = new Matrix();
matrix.scale(2, 3);
bmd.draw(sprite, matrix);
var bmp:Bitmap = new Bitmap(bmd);
addChild(bmp);
}
}
}