BitmapFill 动态加载图片
Flex 4中如何通过BitmapFill和LinearGradient,给Panel设置bitmap填充背景色
private function getBorderBackground(url:String):void
{
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, handleLoadComplete);
loader.load( new URLRequest(url) );
}
private function handleLoadComplete( evt:Event ):void
{
var bmp:Bitmap = ( evt.target as LoaderInfo ).content as Bitmap;
bgImage.source = bmp;
}
<s:Rect>
<s:fill>
<s:BitmapFill id="bgImage" fillMode="{BitmapFillMode.REPEAT}" rotation="-45" />
</s:fill>
</s:Rect>
Flex 4中如何通过BitmapFill和LinearGradient,给Panel设置bitmap填充背景色
<s:Panel id="pnl"
title="Spark Panel title"
width="320" height="240"
horizontalCenter="0" verticalCenter="0">
<s:Rect width="100%" height="100%">
<s:fill>
<s:BitmapFill source="@Embed('assets/pattern_140.gif')" />
</s:fill>
</s:Rect>
<s:Rect width="100%" height="100%">
<s:fill>
<s:LinearGradient rotation="{rotationSlider.value}">
<s:GradientEntry color="white"
alpha="0.0"
ratio="0.0" />
<s:GradientEntry color="#F0EBD2"
alpha="1.0"
ratio="{ratioSlider.value}" />
</s:LinearGradient>
</s:fill>
</s:Rect>
<s:TextArea id="textArea"
verticalScrollPolicy="on"
left="20" right="20"
top="20" bottom="20">
<s:text>The quick brown fox jumps over the lazy dog.</s:text>
</s:TextArea>
</s:Panel>