FLEX中使用BitmapFill的source属性指定SVG类文件
2009-12-25 15:08
323 查看
FLEX中使用BitmapFill的source属性指定SVG类文件
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
backgroundGradientColors="[#333333, #222222]"
xmlns:degrafa="com.degrafa.*"
xmlns:paint="com.degrafa.paint.*"
xmlns:geometry="com.degrafa.geometry.*">
<degrafa:Surface verticalCenter="0" horizontalCenter="0">
<degrafa:fills>
<paint:BitmapFill id="bitmapFill" source="{svgTest}" smooth="true"/>
</degrafa:fills>
<degrafa:GeometryGroup scaleX="1" scaleY="1">
<geometry:Circle fill="{bitmapFill}" radius="450"/>
</degrafa:GeometryGroup>
</degrafa:Surface>
<mx:Script>
<![CDATA[
[Embed(source="circle.svg")]
[Bindable]
public var svgTest:Class;
]]>
</mx:Script>
</mx:Application>
circle.svg:
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<desc>All SVG documents should have a description</desc>
<defs>
<!-- Items can be defined for later use -->
</defs>
<g>
<circle cx="15" cy="15" r="15" fill="red"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
backgroundGradientColors="[#333333, #222222]"
xmlns:degrafa="com.degrafa.*"
xmlns:paint="com.degrafa.paint.*"
xmlns:geometry="com.degrafa.geometry.*">
<degrafa:Surface verticalCenter="0" horizontalCenter="0">
<degrafa:fills>
<paint:BitmapFill id="bitmapFill" source="{svgTest}" smooth="true"/>
</degrafa:fills>
<degrafa:GeometryGroup scaleX="1" scaleY="1">
<geometry:Circle fill="{bitmapFill}" radius="450"/>
</degrafa:GeometryGroup>
</degrafa:Surface>
<mx:Script>
<![CDATA[
[Embed(source="circle.svg")]
[Bindable]
public var svgTest:Class;
]]>
</mx:Script>
</mx:Application>
circle.svg:
<?xml version="1.0"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<desc>All SVG documents should have a description</desc>
<defs>
<!-- Items can be defined for later use -->
</defs>
<g>
<circle cx="15" cy="15" r="15" fill="red"/>
</g>
</svg>
相关文章推荐
- MyBatis Generator配置文件--指定生成实体类使用实际的表列名作为实体类的属性名
- 使用Bitmap保存图片文件到指定路径
- [Linux文件属性]使用stat函数获得指定文件的属性
- [Linux文件属性]使用remove函数删除指定文件
- [Linux文件属性]使用umask函数指定新建文件权限
- [Linux文件属性]使用chmod函数修改指定文件权限
- MyBatis Generator配置文件--指定生成实体类使用实际的表列名作为实体类的属性名
- [Linux文件属性]使用lstat函数获得指定文件的属性
- Content-Disposition 指定该被下载时的名称:attachment和inline的区别,使用a标签下载时,文件的ContentDisposition属性设置
- 使用ICSharpCode.SharpZipLib.dll解压指定文件
- Maven 使用profile以文件形式指定开发、生产等不同的环境
- [转载收藏]使用JAVA读写Properties属性文件
- spring学习笔记六 使用外部属性文件
- Spring4 学习系列之——使用外部属性文件
- [Linux文件属性]使用fcntl函数获取文件标志
- 使用lua代码创建文件夹,解压zip文件到指定目录(亲测可用)
- 使用ScrollView属性fillViewport解决android布局不能撑满全屏的问题
- 使用maven profile指定配置文件打包适用多环境
- Spring_使用外部属性文件
- 【spring mvc(二)】spring mvc使用属性文件配置c3p0和dbcp数据源