Illustrator CS4之fxg文件格式(MXML) Vs WPF之XAML
2009-01-03 23:28
239 查看
在Illustrator CS4中,可以将图形文件用 FXG 格式存储。根据Adobe文档,在 Illustrator 中创建可在 Adobe Flex® 中使用的结构化图形时,可将文件存储为 Flash XML 图形格式 (FXG) 格式。
先来看看一个例子:
这个例子非常简单,画一个带填充色和边框的矩形。
看看FXG代码:
<?xml version="1.0" encoding="utf-8" ?>
<Graphic version="1.0" viewHeight="100" viewWidth="106" xmlns="http://ns.adobe.com/fxg/2008">
<Group d:type="layer" d:userLabel="Layer 1" xmlns:d="http://ns.adobe.com/fxg/2008/dt">
<Rect x="0.5" y="0.5" width="105" height="99">
<fill>
<SolidColor color="#ffee00"/>
</fill>
<stroke>
<SolidColorStroke color="#e60012" caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Rect>
</Group>
</Graphic>
FXG 是基于 MXML(由 FLEX 框架使用的基于 XML 的编程语言)子集的图形文件格式。可以在 Adobe Flex Builder 等应用程序中使用 FXG 文件以开发丰富多采的 Internet 应用程序和体验。存储为 FXG 格式时,图像的总像素必须少于 6,777,216,并且长度或宽度应限制在 8192 像素范围内。
同样的东西,在XAML中:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Canvas Width="106" Height="100">
<Path Stroke="#e60012" StrokeThickness="1" Fill="#ffee00">
<Path.Data>
<RectangleGeometry Rect="0.5,0.5,105,99" />
</Path.Data>
</Canvas>
</Page>
通过比较,我们可以看到XAML与MXML的命名空间及元素语法是不一样的。XAML遵循首字母大写,而MXML则所有属性的首字母均是小写!
先来看看一个例子:
这个例子非常简单,画一个带填充色和边框的矩形。
看看FXG代码:
<?xml version="1.0" encoding="utf-8" ?>
<Graphic version="1.0" viewHeight="100" viewWidth="106" xmlns="http://ns.adobe.com/fxg/2008">
<Group d:type="layer" d:userLabel="Layer 1" xmlns:d="http://ns.adobe.com/fxg/2008/dt">
<Rect x="0.5" y="0.5" width="105" height="99">
<fill>
<SolidColor color="#ffee00"/>
</fill>
<stroke>
<SolidColorStroke color="#e60012" caps="none" weight="1" joints="miter" miterLimit="4"/>
</stroke>
</Rect>
</Group>
</Graphic>
FXG 是基于 MXML(由 FLEX 框架使用的基于 XML 的编程语言)子集的图形文件格式。可以在 Adobe Flex Builder 等应用程序中使用 FXG 文件以开发丰富多采的 Internet 应用程序和体验。存储为 FXG 格式时,图像的总像素必须少于 6,777,216,并且长度或宽度应限制在 8192 像素范围内。
同样的东西,在XAML中:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Canvas Width="106" Height="100">
<Path Stroke="#e60012" StrokeThickness="1" Fill="#ffee00">
<Path.Data>
<RectangleGeometry Rect="0.5,0.5,105,99" />
</Path.Data>
</Canvas>
</Page>
通过比较,我们可以看到XAML与MXML的命名空间及元素语法是不一样的。XAML遵循首字母大写,而MXML则所有属性的首字母均是小写!
相关文章推荐
- WPF中XAML文件的基本格式
- 嵌入资源第三讲:多格式文件内嵌入WPF资源文件
- WPF/E CTP Quick Start - 第二部分:创建一个XAML文件(翻译)
- VS之设置文件编码格式
- VS中设置文件编码格式问题
- WPF 把固定格式的外部文件编译到程序中,并在程序中读取
- VS解决方案文件格式说明
- Android Dex VS Class:实例图解剖析两种格式文件结构、优劣
- 新建WPF应用程序操作提示:没有可用于"D:\xx\……\xx.xaml"的编辑器确保已安装文件类型(.xaml)的应用程序
- 新建WPF应用程序操作提示:没有可用于"D:\xx\……\xx.xaml"的编辑器确保已安装文件类型(.xaml)的应用程序
- VS设置文件的编码格式
- 演示:多格式文件内嵌入WPF资源文件
- Wpf实现打印Xaml文件功能
- VS调试时JSON格式文件加载不了
- VS解决方案文件格式说明
- VS2017 warning C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
- VS2013将新建的源码文件的编码格式自动设置成UTF8
- VS2012 中 修改源文件编码格式默认为指定格式
- VS调试时JSON格式文件加载不了,含有cmd命令(可直接粘贴)
- 用Flash CS4打开fla文件提示“意外的格式”的解决方法