Solved

Need to create a diagram(rectangle) in Flex app using svg

Posted on 2009-07-09
1
566 Views
Last Modified: 2012-05-07
I need to create a diagram(rectangle) in Flex, I can read the svg into an array of points, I need to create a rectangle from those points.

Here is the svg in a file

<g id="rectangle" transform="translate(18.9296,-1.5)">
                    <title>Sheet.5</title>
                    <path d="M0 153.75 L,71.77 153.75 L,71.77 3 L,0 3 L,0 153.75 L,0 153.75" class="st1"/>
  </g>

my points array
0 153.75  -- Move point
71.77 153.75
71.77  3
0  3
0  153.75
0  153.75

I still need to parse the transform, but I initialy I needed help in creating a diagram(in this case rectangle) from the above points x and y coordinates
0
Comment
Question by:gagangill
1 Comment
 
LVL 9

Accepted Solution

by:
danyul_c earned 500 total points
ID: 24829147
What you are going to want to do is to separate your array of points into your initial x and y positions (in this case I would say 0, 3) and then the width and height (71.77, 150.75).

Then you can draw it with the code I've written below.

If you don't want a line or dont want a fill simply leave those lines out.
var rect:UIComponent = new UIComponent();

rect.graphics.beginFill(0x000000) //Or whatever fill colour

rect.graphics.lineStyle(1, 0x000000) //Again choose your own line thickness and colour

rect.graphics.drawRect(0, 3, 71.77, 150.75);

rect.graphics.endFill();

addChild(rect);

Open in new window

0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
A short film showing how OnPage and Connectwise integration works.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now