genonymous
genonymous

Reputation: 1750

Zooming SVG images at flex side

Following are sub-parts of my question:

  1. How can I send generated svg file from server (java) to client(flex)? (Should I send it as ByteArray or use some other method?)
  2. How can I display this svg from flex? (Should I just set the source property of image file svg as xml?)
  3. How can I zoom this svg from flex side?

Upvotes: 0

Views: 153

Answers (1)

JeffryHouser
JeffryHouser

Reputation: 39408

How can I send generated svg file from server (java) to client(flex)? (Should I send it as ByteArray or use some other method?)

SVG is a text format; so if you're looking for an easy way to send it over the wire; I'd use text.

How can I display this svg from flex? (Should I just set the source property of image file svg as xml?)

SVG is not a native format to the Flash Player. I think you'll need to build an ActionScript based SVG renderer/viewer to do anything with an SVG viewer in a Flash Platform app. Here is one such library.

I believe the Flex compiler can do some magic on SVG to make it into something usable in Flex. More info about that here. You have to embed the SVG graphic at compile time; it won't do anything at runtime.

You may be able to compile the SVG to a SWF on the server using command line tools and then have your Flex app load the SWF.

How can I zoom this svg from flex side?

Once you figure out how you want to display it as a Flex Component, you can use the scaleX, scaleY, and scaleZ properties to zoom in or out.

Upvotes: 1

Related Questions