Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 2.18 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Scaling SVG images in Flex
  2. <?xml version="1.0" encoding="utf-8"?>
  3. <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" actionBarVisible="false"
  4.         xmlns:s="library://ns.adobe.com/flex/spark" title="Table">
  5.     <s:layout>
  6.         <s:HorizontalLayout paddingTop="10"/>
  7.     </s:layout>
  8.     <fx:Script>
  9.         <![CDATA[
  10.             [Embed(source="/assets/table.svg")]
  11.             [Bindable]
  12.             public var table:Class;
  13.         ]]>
  14.     </fx:Script>
  15.         <s:Image source="{table}" width="50%" height="50%" verticalCenter="0" horizontalCenter="0" scaleMode="stretch" smooth="true" smoothingQuality="high"/>
  16. </s:View>
  17.        
  18. <?xml version="1.0" encoding="utf-8"?>
  19. <!-- Generator: Adobe Illustrator 15.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
  20. <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
  21. <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1024px"
  22.      height="600px" viewBox="0 0 1024 600" enable-background="new 0 0 1024 600" xml:space="preserve">
  23. <g id="Layer_2">
  24.     <path fill="#3C2415" stroke="#000000" stroke-miterlimit="10" d="M961,463.486c0,52.262-42.366,94.627-94.627,94.627H104.627
  25.         C52.366,558.113,10,515.748,10,463.486V161.627C10,109.366,52.366,67,104.627,67h761.746C918.634,67,961,109.366,961,161.627
  26.         V463.486z"/>
  27. </g>
  28. <g id="Layer_1">
  29.     <path fill="#006838" stroke="#000000" stroke-miterlimit="10" d="M947.752,450.238c0,52.262-42.365,94.627-94.626,94.627H119.767
  30.         c-52.261,0-94.626-42.365-94.626-94.627V175.821c0-52.261,42.366-94.627,94.626-94.627h733.359
  31.         c52.261,0,94.626,42.366,94.626,94.627V450.238z"/>
  32.     <path fill="#A97C50" stroke="#000000" stroke-miterlimit="10" d="M457,248.5c0,37.832-30.668,68.5-68.5,68.5h-115
  33.         c-37.832,0-68.5-30.668-68.5-68.5l0,0c0-37.832,30.668-68.5,68.5-68.5h115C426.332,180,457,210.668,457,248.5L457,248.5z"/>
  34. </g>
  35. </svg>
  36.        
  37. <s:Image source="{table}" width="50%" height="50%"
  38.        
  39. <s:Image source="{table}" width="{table.width}" height="{table.height}"
  40.        
  41. <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
  42. width="100%" height="100%"
  43. viewBox="0 0 1024 600"
  44. preserveAspectRatio="xMinYMin meet">