Solved

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

Posted on 2009-07-09
1
572 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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

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…
If you troubleshoot Outlook for clients, you may want to know a bit more about the OST file before doing your next job. IMAP can cause a lot of drama if removed in the accounts without backing up.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

729 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