当前位置: > > > Flex4 - 使用RectangularDropShadow添加矩形阴影

Flex4 - 使用RectangularDropShadow添加矩形阴影

Flex4中,想要给元件添加阴影可以使用DropShadowFilter或RectangularDropShadow,它们的区别如下:

1,DropShadowFilter:可以给任意不规则的形状添加阴影,但更耗资源。

2,RectangularDropShadow:只能绘制矩形阴影(可以带圆角),效率高。
<s:Group width="300" height="150" horizontalCenter="0" verticalCenter="0">
	<s:RectangularDropShadow id="dropShadow" blurX="10" blurY="10" alpha="0.5" distance="3"
		 angle="90" color="#000000" left="0" top="0" right="0" bottom="0" blRadius="8" brRadius="8"
		 tlRadius="8" trRadius="8" />
</s:Group>
   效果图如下:
 
(注:BorderContainer或者Panel等容器自带了阴影,这通过dropShadowVisible样式设定,此样式如果设为true,则显示阴影。而它们内部实现使用的也是RectangularDropShadow。)
评论0