Solved

SVG Star

Posted on 2016-11-22
4
33 Views
Last Modified: 2016-11-23
For the 5 points in SVG start, does it correspond to x, y coordination ?

Where does 0,0 refer ? Does it refer based on the width and height of the svg ?  Thx


<svg width="300" height="200">
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg>
0
Comment
Question by:AXISHK
  • 2
4 Comments
 
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 250 total points
ID: 41898645
This article https://en.wikipedia.org/wiki/Scalable_Vector_Graphics shows 0,0 to be the upper left corner of the SVG object.
0
 
LVL 52

Accepted Solution

by:
Julian Hansen earned 250 total points
ID: 41898742
Consider this progressive drawing of the star
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="0,0,100,10"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="100,10 40,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="100,10 40,198 190,78"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="100,10 40,198 190,78 10,78"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 
<svg width="300" height="200" style="border: 1px solid black">
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg> 

Open in new window

Renders like this
-ss95.jpgWorking sample here
0
 

Author Closing Comment

by:AXISHK
ID: 41900042
Thx
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 41900084
You are welcome.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

947 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

18 Experts available now in Live!

Get 1:1 Help Now