将文本转换为具有透明背景的位图或动画片段

svK*_*ris 4 actionscript-3

如何将文本转换为具有透明背景的位图或mocieclip.我可以将文本转换为位图,但它有一个白色的背景..

mey*_*tee 7

您必须确保使用透明的background-fill-color(构造函数的第4个参数)初始化BitmapData对象.这应该工作(假设你在TextField中有你的文字):

var snapshot:BitmapData = new BitmapData(textField.width, textField.height, true, 0x00000000);
snapshot.draw(textField, new Matrix());
Run Code Online (Sandbox Code Playgroud)

另请参见BitmapData构造函数as3文档