Avg. Rating 1.0

Problem

It wont show any 9-slice scale effect when setting "backgroundImage" property with 9-slice scale information to a Canvas control.

Solution

In addition to "backgroundImage" property and its necessary attributes, you need to setup another property "backgroundSize"

Detailed explanation

Not like HBox, VBox , a simple "backgroundImage" property with its 9-slice scale information just do the job, the same thing does not happen to Canvas.

In addition to "backgroundImage" property and its necessary attributes something like below: 
 
        backgroundImage="@Embed(source='./style_assets.png', 
                scaleGridTop=50,scaleGridBottom=76,scaleGridLeft=75,scaleGridRight=510)"
 
  
 
a "backgroundSize" property is also needed:
        backgroundSize = "100%"
Example:
                <mx:Canvas 
backgroundImage="@Embed(source='./style_assets.png', 
                scaleGridTop=50,scaleGridBottom=76,scaleGridLeft=75,scaleGridRight=510)" 
                width="100%" height="100%" 
backgroundSize="100%">
 
  

+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes