ایس وی جی <polygon>

SVG ਮੋਲਟੀਗੋਨ - <polygon>

<polygon> ਇਲੀਮੈਂਟ ਮਿਨੀਮਲ ਤਿੰਨ ਪਾਸੇ ਵਾਲੇ ਗਰਾਫਿਕਸ ਬਣਾਉਣ ਲਈ ਵਰਤਿਆ ਜਾਂਦਾ ਹੈ。

ਮੋਲਟੀਗੋਨ ਪ੍ਰਤੀਯੋਗਿਤਾ ਦੁਆਰਾ ਬਣਾਏ ਗਏ ਹਨ ਅਤੇ ਵਰਣਨਯੋਗ "ਬੰਦ" ਹਨ (ਸਾਰੀਆਂ ਲਾਈਨਾਂ ਜੋੜੀਆਂ ਗਈਆਂ ਹਨ)

Polygon ਇੱਕ ਗ੍ਰੀਕ ਸ਼ਬਦ ਹੈ।"Poly" ਮਤਲਬ "ਬਹੁਤ" ਅਤੇ "gon" ਮਤਲਬ "ਕੋਣ" ਹੈ。

ਉਦਾਹਰਣ 1

ਹੇਠ ਦਾ ਉਦਾਹਰਣ ਤਿੰਨ ਪਾਸੇ ਵਾਲੇ ਮੋਲਟੀਗੋਨ ਬਣਾਉਂਦਾ ਹੈ:

ਇਹ SVG ਕੋਡ ਹੈ:

<svg height="210" width="500">
  <polygon points="200,10 250,190 160,210" style="fill:lime;stroke:purple;stroke-width:1" />
</svg>

خود بخود کوشش کریئن

ਕੋਡ ਵਿਸ਼ਲੇਸ਼ਣ:

  • points ਪ੍ਰਤੀਯੋਗਿਤਾ ਪ੍ਰਤੀਯੋਗਿਤਾ ਹਰੇਕ ਕੋਣ ਦੇ x ਅਤੇ y ਨਿਸ਼ਾਨਾ ਨੂੰ ਨਿਰਧਾਰਿਤ ਕਰਦੀ ਹੈ

ਉਦਾਹਰਣ 2

ਹੇਠ ਦਾ ਉਦਾਹਰਣ ਚਾਰ ਪਾਸੇ ਵਾਲੇ ਮੋਲਟੀਗੋਨ ਬਣਾਉਂਦਾ ਹੈ:

ਇਹ SVG ਕੋਡ ਹੈ:

<svg height="250" width="500">
 <polygon points="220,10 300,210 170,250 123,234" style="fill:lime;stroke:purple;stroke-width:1" />
</svg>

خود بخود کوشش کریئن

ਉਦਾਹਰਣ 3

ਵਰਤੋਂ <polygon> ਇੱਕ ਤਾਰਾ ਬਣਾਉਣ ਲਈ ਏਲੀਮੈਂਟ ਕਰੋ:

ਇਹ SVG ਕੋਡ ਹੈ:

<svg height="210" width="500">
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:nonzero;" />
</svg>

خود بخود کوشش کریئن

ਉਦਾਹਰਣ 4

fill-rule ਪ੍ਰਤੀਯੋਗਿਤਾ ਨੂੰ ਬਦਲ ਦਿਓ "evenodd":

ਇਹ SVG ਕੋਡ ਹੈ:

<svg height="210" width="500">
  <polygon points="100,10 40,198 190,78 10,78 160,198"
  style="fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;" />
</svg>

خود بخود کوشش کریئن