在bitmapData上绘制形状,透明度丢失

时间:2013-12-11 07:01:46

标签: actionscript-3 haxe

我正在将一个圆角矩形绘制到BitmapData:(bg)

var bg:Shape= new Shape();
bg.graphics.beginFill(0xdddddd);
bg.graphics.drawRoundRect(0, 0, 200, 400, 20);
bg.graphics.endFill();

var imageData:BitmapData = new BitmapData(bg.width, bg.height);
image.draw(bg);

但是当我从imageData创建一个Bitmap时,位图角落并不像预期的那样透明,而是它的白色......任何想法?

1 个答案:

答案 0 :(得分:2)

尝试:

// see the argb color value 0x00000000 -> the first two '0' after '0x' are for transparency
var imageData:BitmapData = new BitmapData( bg.width, bg.height, true, 0x00000000 );
相关问题