Flex: Render an unrealized UIComponent to BitmapData?

后端 未结 4 1456
没有蜡笔的小新
没有蜡笔的小新 2020-12-15 12:36

What is the best way to render to a UIComponent which hasn\'t been added to the stage? (I\'m using UIComponents as renderers for objects, and want to render ne

4条回答
  •  没有蜡笔的小新
    2020-12-15 13:32

    You can call the lifecycle function manually before using the BitmapData.draw(). Do the following.

    1. createChildren().
    2. commitProperties().
    3. updateDisplayList().
    4. bmd.draw().

    The first 2 steps are not 100% necessary, you can put all codes into updateDisplayList(). Because you invoke the function manually, you don't have to worry this is invoked by Flex framework many times.

提交回复
热议问题