Solved

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

Posted on 2009-07-09
1
565 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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

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…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

10 Experts available now in Live!

Get 1:1 Help Now