我想将Flare3d场景保存为一个png文件使用actionscript
这是我已经尝试,我可以保存文件,但图像是不透明的(它是显示黑色背景),我想要删除
var bmpd:BitmapData = new BitmapData(scene.viewPort.width, scene.viewPort.height,true,0x00000000 );
scene.context.clear();
scene.render();
scene.context.drawToBitmapData( bmpd );
var ba:ByteArray = PNGEncoder.encode(bmpd);
var file:FileReference = new FileReference();
file.addEventListener(Event.COMPLETE, saveSuccessful1);
file.save(ba, "image3d.png");

有没有更好的方法来获得透明的图像?
谢谢
发布于 2013-01-30 18:16:36
它实际上创建了透明的图像
BitmapData的最后一个属性是填充颜色,它将填充您所说的内容
var bmpd:BitmapData = new BitmapData(scene.viewPort.width, scene.viewPort.height,true,0xFFFFFF );现在它将用白色背景填充
发布于 2015-09-24 05:50:32
很简单,只需在scene.context.clear(0,0,0,0);中将alpha设置为零
当然,您已经正确地将BitmapData设置为透明和0填充颜色。
https://stackoverflow.com/questions/14442602
复制相似问题