|
CamoDisplay
One-sentence summary of this page.
IntroductionThe CamoDisplay inherits some powerful layout logic from the BoxModelDisplay and extends the applyStyle method by supporting additional CSS properties. Here is a list of the properties supported by the CamoDisplay: Details
The most important functionality added by the CamoDisplay is the rasterize method. Just like the BoxModelDisplay which draws its border, background-color, and background-image to the graphics layer to save memory, the CamoDisplay can do the same thing with it’s display Sprite. When you call rasterize, a Bitmap snapshot of the display is take, the old display is removed and a new one is put in its place with the previous display's BitmapData drawn to it’s graphics layer. All the children that were attached to the display are removed (so the Garbage Collector can release them from memory) and you are left with a flattened display. It is important to note that rasterize can only be called once since all children in the display are removed. The speed and memory benefits can greatly increase the performance of your application. This also allows you to layer images in the display Sprite and then flatten them into a single image. Rasterize should be used on any CamoDisplay where its children will never be changed or used outside of the initial setup of the class. 5 Calling the refresh method on a BoxModelDisplay is considered expensive and should only be used when needed. 6 Margin is not accounted for in offset of the display sprite unlike Padding. Instead Margin is a value accessible through the margin property and should be used by classes that layout or align BoxModelDeisplays. |
Sign in to add a comment