【复用】自定义控件之-高级图像控件

介绍了一款名为AdvancedImage的FLEX图像显示控件,该控件支持定制圆角、交叉溶解效果等功能,并允许用户轻松定义鼠标悬停时的显示对象。

使用FLEX的时候总是希望能够有足够多的控件来用,实际上自FLEX流行以来网络上也已经出现了各种各样的FLEX的插件,控件,所以下次你要编写一个什么控件的时候,先停下来GOOGLE一下说不定人家已经写好了呢,(最近看见的一个奇特的东西就是MAC地址的输入控件了,这样的东西都存在了,还有什么不可能呢),再比如下面介绍的这款图像显示控件,如果你需要一个很酷的图像显示控件,那么别犹豫就是它了,可以定制圆角,交叉效果,溶解效果....不说了直接献上


My new AdvancedImage component takes a few seperate and common needs for an image and rolls it into one nice package. AdvancedImage will allow you to easily define rounded corners (seperatly), pass in a rollover DisplayObject and will even handle cross-dissolves. I needed to provide this component to someone newer to Flex so I tried to makes it's use as simple as possible.

<graphics:AdvancedImage
id="myExample"
width="150"
height="170"
topRightCornerRadius="8"
bottomRightCornerRadius="8"
source="assets/waterfall.jpg"
crossOverEffect="{createCOE()}"
mouseOverObject="{getMouseOverMask()}"
/>

  • crossOverEffect is the effect you wish to use when changing images. when you update myExample.source, if an effect has been defined it will use that method to display the new image on top of the old one. Otherwise myExample.source = "newImage.jpg" will work just like a regular Image component.
  • mouseOverObject is just that. If you pass in a displayObject, on mouse over, that object will be enlarges to the same size as the image and displayed. In my code example I'm just using a simple white canvas with alpha set to 0.46. This is a simpler than expected example of a mouseOverObject.
  • The corner radiuses are applied via a top level Canvas, AdvancedImage actualy extends Canvas, not Image. So any images or mouse overs you pass in will be masked.

Download the latest version of AdvancedImage

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值