【发布时间】:2012-07-14 07:38:09
【问题描述】:
我正在尝试在屏幕上绘制一些东西,然后将其复制到舞台上的位图上。
我以前做过这个,程序绘制的形状像一个圆形,但是当我使用库项目时,大部分源像素都会被切断。
这是我的代码 - 在另一个函数中,位图对象被添加到舞台上,我可以看到 copyPixels 可以工作,但正如我所说的,它只复制了一些像素。我试过玩 Rectangle 但到目前为止没有运气。
var s:StarAsset = new StarAsset();
s.x = e.stageX;
s.y = e.stageY;
s.scaleX = e.pressure * 10;
s.scaleY = e.pressure * 10;
s.rotation = Math.random() * 360;
var bms:BitmapData = new BitmapData(s.width + 6, s.height + 6, true, 0x00000000);
bms.draw(s);
var srect:Rectangle = new Rectangle();
srect.width = s.width + 6;
srect.height = s.height + 6;
var destpoint:Point = new Point(s.x, s.y);
bmcontainer.copyPixels(bms, srect, destpoint, null, null, true);
【问题讨论】:
标签: actionscript-3 bitmap bitmapdata