Solved

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

Posted on 2009-07-09
1
573 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
This article is written by John Gates, CISSP. Gates, the SNUG President-Elect, currently holds the position of Manager of Information Systems at Lake Park High School in Roselle, Illinois.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

630 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