zoukankan      html  css  js  c++  java
  • FLEX中使用BitmapFill的source属性指定SVG类文件

    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>

  • 相关阅读:
    事件聚合IEventAggregator和 Ihandle<T>
    基于.NET打造IP智能网络视频监控系统
    包图Package
    MVC与EasyUI结合增删改查
    Helper Method
    Moq & RhinoMocks
    Asp.net MVC集成Google Calendar API(附Demo源码)
    你可能不知道的跨域解决方案
    jQuery选择器大全
    关于Sqlite的一个demo
  • 原文地址:https://www.cnblogs.com/frogbag/p/1632155.html
Copyright © 2011-2022 走看看