Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fxg convertor to bitmap data

  • Loading branch information...
commit 599fa0994d9c63cfb07ef2e255c203795628aae9 1 parent 27923d4
Elad Elrom authored
108 bin-debug/ConvertFXGToBitmapData.html
... ... @@ -0,0 +1,108 @@
  1 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2 +<!-- saved from url=(0014)about:internet -->
  3 +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  4 + <!--
  5 + Smart developers always View Source.
  6 +
  7 + This application was built using Adobe Flex, an open source framework
  8 + for building rich Internet applications that get delivered via the
  9 + Flash Player or to desktops via Adobe AIR.
  10 +
  11 + Learn more about Flex at http://flex.org
  12 + // -->
  13 + <head>
  14 + <title></title>
  15 + <meta name="google" value="notranslate" />
  16 + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  17 + <!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
  18 + the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
  19 + the percentage of the height of its parent container, which has to be set explicitly. Fix for
  20 + Firefox 3.6 focus border issues. Initially, don't display flashContent div so it won't show
  21 + if JavaScript disabled.
  22 + -->
  23 + <style type="text/css" media="screen">
  24 + html, body { height:100%; }
  25 + body { margin:0; padding:0; overflow:auto; text-align:center;
  26 + background-color: #ffffff; }
  27 + object:focus { outline:none; }
  28 + #flashContent { display:none; }
  29 + </style>
  30 +
  31 + <!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
  32 + <!-- BEGIN Browser History required section -->
  33 + <link rel="stylesheet" type="text/css" href="history/history.css" />
  34 + <script type="text/javascript" src="history/history.js"></script>
  35 + <!-- END Browser History required section -->
  36 +
  37 + <script type="text/javascript" src="swfobject.js"></script>
  38 + <script type="text/javascript">
  39 + // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
  40 + var swfVersionStr = "10.2.0";
  41 + // To use express install, set to playerProductInstall.swf, otherwise the empty string.
  42 + var xiSwfUrlStr = "playerProductInstall.swf";
  43 + var flashvars = {};
  44 + var params = {};
  45 + params.quality = "high";
  46 + params.bgcolor = "#ffffff";
  47 + params.allowscriptaccess = "sameDomain";
  48 + params.allowfullscreen = "true";
  49 + var attributes = {};
  50 + attributes.id = "ConvertFXGToBitmapData";
  51 + attributes.name = "ConvertFXGToBitmapData";
  52 + attributes.align = "middle";
  53 + swfobject.embedSWF(
  54 + "ConvertFXGToBitmapData.swf", "flashContent",
  55 + "100%", "100%",
  56 + swfVersionStr, xiSwfUrlStr,
  57 + flashvars, params, attributes);
  58 + // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
  59 + swfobject.createCSS("#flashContent", "display:block;text-align:left;");
  60 + </script>
  61 + </head>
  62 + <body>
  63 + <!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
  64 + JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
  65 + when JavaScript is disabled.
  66 + -->
  67 + <div id="flashContent">
  68 + <p>
  69 + To view this page ensure that Adobe Flash Player version
  70 + 10.2.0 or greater is installed.
  71 + </p>
  72 + <script type="text/javascript">
  73 + var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
  74 + document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
  75 + + pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a>" );
  76 + </script>
  77 + </div>
  78 +
  79 + <noscript>
  80 + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="ConvertFXGToBitmapData">
  81 + <param name="movie" value="ConvertFXGToBitmapData.swf" />
  82 + <param name="quality" value="high" />
  83 + <param name="bgcolor" value="#ffffff" />
  84 + <param name="allowScriptAccess" value="sameDomain" />
  85 + <param name="allowFullScreen" value="true" />
  86 + <!--[if !IE]>-->
  87 + <object type="application/x-shockwave-flash" data="ConvertFXGToBitmapData.swf" width="100%" height="100%">
  88 + <param name="quality" value="high" />
  89 + <param name="bgcolor" value="#ffffff" />
  90 + <param name="allowScriptAccess" value="sameDomain" />
  91 + <param name="allowFullScreen" value="true" />
  92 + <!--<![endif]-->
  93 + <!--[if gte IE 6]>-->
  94 + <p>
  95 + Either scripts and active content are not permitted to run or Adobe Flash Player version
  96 + 10.2.0 or greater is not installed.
  97 + </p>
  98 + <!--<![endif]-->
  99 + <a href="http://www.adobe.com/go/getflashplayer">
  100 + <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash Player" />
  101 + </a>
  102 + <!--[if !IE]>-->
  103 + </object>
  104 + <!--<![endif]-->
  105 + </object>
  106 + </noscript>
  107 + </body>
  108 +</html>
BIN  bin-debug/ConvertFXGToBitmapData.swf
Binary file not shown
BIN  bin-debug/Main.swf
Binary file not shown
BIN  bin-debug/mx_4.5.1.21328.swf
Binary file not shown
35 src/ConvertFXGToBitmapData.mxml
... ... @@ -0,0 +1,35 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
  3 + xmlns:s="library://ns.adobe.com/flex/spark"
  4 + xmlns:mx="library://ns.adobe.com/flex/mx"
  5 + minWidth="955" minHeight="600" xmlns:local="*">
  6 +
  7 + <fx:Script>
  8 + <![CDATA[
  9 + import com.elad.optimize.utils.FXGHelper;
  10 +
  11 + import spark.components.Group;
  12 + import spark.components.Image;
  13 +
  14 + private function convertToBitmapData(group:Group):void
  15 + {
  16 + var bitmapData:BitmapData = FXGHelper.getBitmapData( group );
  17 + var bitmap:Bitmap = new Bitmap( bitmapData );
  18 + bitmap.smoothing = true;
  19 + var image:Image = new Image();
  20 + image.source = bitmapData.clone();
  21 + image.y = 50;
  22 +
  23 + this.addElement( image );
  24 + }
  25 +
  26 + ]]>
  27 + </fx:Script>
  28 +
  29 + <s:Button x="150" label="convert fxg2bitmap" click="convertToBitmapData(fxgAsset)" />
  30 +
  31 + <s:Group id="fxgAsset" >
  32 + <local:FxgAsset />
  33 + </s:Group>
  34 +
  35 +</s:Application>
18 src/FxgAsset.fxg
... ... @@ -0,0 +1,18 @@
  1 +<?xml version='1.0' encoding='UTF-8'?>
  2 +<Graphic xmlns:fc="http://ns.adobe.com/flashcatalyst/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns="http://ns.adobe.com/fxg/2008" xmlns:flm="http://ns.adobe.com/flame/2008" version="2.0">
  3 + <Group flm:knockout="false">
  4 + <Path winding="nonZero" x="1.278" y="1.271" data="M 0 7.782 L 7.654 0.126 C 8.75 0.828 10.005 1.196 11.309 1.196 C 12.697 1.196 14.019 0.784 15.155 0 L 22.936 7.781 L 11.468 19.25 L 0 7.782 Z">
  5 + <fill>
  6 + <LinearGradient rotation="90" scaleX="41.4187" x="11.468" y="-0.258">
  7 + <GradientEntry color="#FFDE17" ratio="0"/>
  8 + <GradientEntry color="#F4B321" ratio="1"/>
  9 + </LinearGradient>
  10 + </fill>
  11 + </Path>
  12 + <Path winding="nonZero" x="0.571" y="0.614" data="M 15.795 1.297 L 22.936 8.438 L 12.175 19.2 L 2.412 9.438 L 2.414 9.438 L 1.414 8.438 L 8.438 1.413 C 9.529 2.031 10.751 2.354 12.016 2.354 C 13.366 2.354 14.657 1.99 15.795 1.297 M 15.912 0 C 14.838 0.846 13.488 1.354 12.016 1.354 C 10.625 1.354 9.344 0.898 8.301 0.137 L 0.035 8.402 L 0 8.438 L 0.002 8.439 L 0 8.439 L 12.175 20.614 L 24.349 8.439 L 24.35 8.438 L 15.912 0 L 15.912 0 Z">
  13 + <fill>
  14 + <SolidColor color="#ED1C24"/>
  15 + </fill>
  16 + </Path>
  17 + </Group>
  18 +</Graphic>

0 comments on commit 599fa09

Please sign in to comment.
Something went wrong with that request. Please try again.