Flex Rect用法

<?xml version="1.0" encoding="utf-8"?>
<!-- RectExample.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark">
	
	<s:Panel title="Rectangle Graphic Example"
			 width="75%" height="75%"
			 horizontalCenter="0" verticalCenter="0">
		<s:Group left="10" right="10" top="10" bottom="10">
			
			<!-- Draw rectangle with square corners. -->
			<s:Graphic x="0" y="0">
				<!--颜色填充-->
				<s:Rect height="100" width="200">
					<s:stroke>
						<s:SolidColorStroke color="0x000000" weight="2"/>
					</s:stroke>
					<s:fill>
						<s:RadialGradient>
							<s:entries>
								<s:GradientEntry color="0x0056FF" ratio="0.00" alpha="0.5"/>
							</s:entries>
						</s:RadialGradient>
					</s:fill>
				</s:Rect>
			</s:Graphic>
			
			<!-- Draw rectangle with rounded corners. -->
			<s:Graphic x="250" y="0" alpha="0.5">
				<!--渐变颜色填充-->
				<s:Rect height="100" width="200" radiusX="25" radiusY="25" alpha="0.5">
					<s:stroke>
						<s:SolidColorStroke color="0x000000" weight="2"/>
					</s:stroke>
					<s:fill>
						<s:RadialGradient>
							<s:entries>
								<s:GradientEntry color="0x0056FF" ratio="0.00" alpha="0.5"/>
								<s:GradientEntry color="0x00CC99" ratio="0.33" alpha="0.5"/>
								<s:GradientEntry color="0xECEC21" ratio="0.66" alpha="0.5"/>
							</s:entries>
						</s:RadialGradient>
					</s:fill>
				</s:Rect>
				<!--图片填充-->
				<s:Rect left="1" right="1" top="1" width="100%" topLeftRadiusX="5"
						topRightRadiusX="5">
					<s:fill>
						<s:BitmapFill id="headerBackground" alpha="1"
									  fillMode="repeat" source="@Embed('skins/back.png')"/>
					</s:fill>
				</s:Rect>
				<s:Rect left="1" right="1" top="31" height="1">
					<s:fill>
						<s:SolidColor color="0xC0C0C0" />
					</s:fill>
				</s:Rect>
			</s:Graphic>
		</s:Group>
	</s:Panel>
	
</s:Application>


 

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值