2
我需要绘制一个位图,但不绘制它的透明像素?如何绘制位图,但不绘制透明像素?
实施例图象这里:http://i.stack.imgur.com/QvJTZ.png
我写了这个代码:
import flash.display.Bitmap;
import flash.events.Event;
import flash.geom.Matrix;
var s:S = new S();
var m_bitmapData = new BitmapData(s.width, s.height, true, 0x00000000);
m_bitmapData.draw(s);
var hole=new Sprite();
var hole_matrix:Matrix
hole.graphics.beginFill(0x000000);
hole.graphics.drawCircle(0,0,30);
var bmp:Bitmap = new Bitmap(m_bitmapData);
bmp.x = 50
bmp.y =50
stage.addChild(bmp);
addEventListener(Event.ENTER_FRAME,asd);
function asd(e:Event):void{
hole_matrix=new Matrix();
hole_matrix.translate(mouseX-bmp.x,mouseY-bmp.y);
m_bitmapData.draw(hole,hole_matrix);
}
但结果是诸如图片 “NO”。
有人能解释一下吗?
非常感谢! –