Convert text to bitmap or movie clip with transparent background

how to convert text to bitmap or mocieclip with transparent background. I could convert the text to a bitmap, but it got a white background.

+4
source share
1 answer

You need to make sure that the BitmapData object is initialized with transparent background-fill-color (4th parameter for the constructor). This should work (if you have text in TextField):

var snapshot:BitmapData = new BitmapData(textField.width, textField.height, true, 0x00000000); snapshot.draw(textField, new Matrix()); 

See also as3 docs for the BitmapData constructor

+7
source

Source: https://habr.com/ru/post/1339550/


All Articles