Home Interview Questions and Answers SVG Interview Questions and Answers For Freshers Part-5

SVG41.How to draw a close ended polygon in SVG?
‘polygon’ tag of SVG is used to draw a polygon. Following is the commonly used attribute −

points – List of points to make up a polygon.

Example −

<polygon
points = “150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5”
stroke = “black”
stroke-width = “3”
fill = “rgb(121,0,121)”>

42.How to draw a open ended polygon in SVG?
‘polyline’ tag of SVG is used to draw a open ended polygon. Following is the commonly used attribute −

points − List of points to make up a polygon.

Example −

<polyline
points = “150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5”
stroke = “black”
stroke-width = “3”
fill = “none”>

43.How to draw a free flow path in SVG?
‘path’ tag of SVG is used to draw a free flow path. Following is the commonly used attribute −

d − path data,usually a set of commands like moveto, lineto etc.

Example −

<path
d = “M 100 100 L 300 100 L 200 300 z”
stroke = “black”
stroke-width = “3”
fill = “rgb(121,0,121)”>

44.Which command of path element moves cursor from one point to another point?
M command of path element move from one point to another point.

45.Which command of path element creates a line?
L command of path element creates a line.

46.Which command of path element creates a horizontal line?
H command of path element creates a horizontal line.

47.Which command of path element creates a vertical line?
V command of path element creates a vertical line.

48.Which command of path element creates a curve?
C command of path element creates a curve.

49.Which command of path element creates a smooth curve?
S command of path element creates a smooth curve.

50.Which command of path element creates quadratic Bezier curve
Q command of path element creates a quadratic Bezier curve.

You may also like

Leave a Comment