Flex中image控件如何添加边框
页面代码:
<?xml version="1.0"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:marsImage="mars.display.*"
backgroundColor="#000000"
layout="absolute">
<marsImage:BorderImage
borderAlpha="{aBar.value}"
borderWidth="{wBar.value}"
borderColor="{colorTool.selectedColor}"
source="@Embed('../img/panda.jpg')"
width="258" height="229" x="180" y="62"/>
<mx:Label x="180" y="327" text="请选择边框颜色" color="#FDFDFD" fontSize="16"/>
<mx:Label x="180" y="391" text="请选择边框宽度" color="#FDFDFD" fontSize="16"/>
<mx:Label x="377" y="391" text="请选择边框透明度" color="#FDFDFD" fontSize="16"/>
<mx:ColorPicker x="305" y="327" color="#FDFDFD" id="colorTool"/>
<mx:VSlider x="525" y="255" minimum="0" maximum="1" id="aBar" />
<mx:HSlider x="180" y="423" minimum="0" maximum="6" id="wBar"/>
</mx:Application>
控件代码如下:
package mars.display
{
import mx.controls.Image;
//边框颜色
[Style(name="borderColor", type="uint", format="Color", inherit="no")]
//边框宽度
[Style(name="borderWidth", type="Number", format="Length", inherit="no")]
//边框透明度
[Style(name="borderAlpha", type="Number", format="Length", inherit="no")]
public class BorderImage extends Image
{
public function BorderImage()
{
super();
}
override protected function updateDisplayList(w:Number, h:Number):void{
super.updateDisplayList(w,h);
graphics.clear();
graphics.lineStyle(getStyle('borderWidth'),getStyle('borderColor'),getStyle('borderAlpha'),false);
var x:Number=-(getStyle('borderWidth
相关文档:
(1)Event Listeners
Listening to parent objects does cause memory leaks
e.g.
& ......
tofino http://www.ensemble.com/products/tofino.html
Ensemble Tofino for Visual Studio is a plugin that enables .NET
developers to create Flex front ends for their applications in the same
IDE that they normally use. Instead of using a separate text or XML
editor and manually invoking the c ......
更多 Flex 4 示例,请到 http://www.slsay.com
现有成熟常用的Flex框架:
Cairngorm (Adobe Open Source) - MVC framework
PureMVC (Open Source) - MVC framework
Mate (Open Source) - tag-based, event-driven
Swiz (Open Source) - Metadata-based Dependency Injection ......
相关下载
Flex正式版EXE下载地址:
http://trials.adobe.com/Applications/Flex/FlexBuilder/3/FB3_WWEJ.exe
Flex正式版插件下载地址:
http://trials.adobe.com/Applications/Flex/FlexBuilder/3/FB3_WWEJ_Plugin.exe
LCDS
官方下载(需要先注册)
https://www.adobe.com/cfusion/tdrc/index.cfm?p ......