Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SVG Star

Posted on 2016-11-22
4
Medium Priority
?
67 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 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 1000 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 60

Accepted Solution

by:
Julian Hansen earned 1000 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 60

Expert Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

This article discusses four methods for overlaying images in a container on a web page
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

773 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