File:Transform example.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 256 × 256 pixels, file size: 364 bytes)

Captions

Captions

Add a one-line explanation of what this file represents
Description

Simple example for viewBox="tx ty w2 h2" and retransforming it

<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256" viewBox="-8 -8 16 16" fill="none">

<path stroke="black" stroke-width="1" d="m-7,0h14M0-7v14"/>
<circle stroke="red" stroke-width="1" r="7"/>
<path stroke="blue" stroke-width="16" d="m0,0h256v256H0z" transform="translate(-8 -8)scale(.0625)"/>

</svg>

The transformation can as well be coded by the matrix 
  transform="matrix(.0625 0 0 .0625 -8 -8)"
Explanation

The real size (w1 × h1) is 256 × 256, the viewBox sets it to (w2 × h2) 16 × 16 with a translation tx = -8 and ty = -8.
In this system a black cross and a red circle are drawn.

By the transform="translate(tx ty)scale(w2/w1 h2/h1)" the real size 256 × 256 is temporary restored.
From the blue square only half of the stroke-width is visible, the other half is outside of the visible area.


Date
Source Own work
Author Sarang
SVG development
InfoField
 
The SVG code is valid.
 
This geometry was created with a text editor.
 
Please do not replace the simplified code of this file with a version created with Inkscape or any other vector graphics editor
Public domain This image of simple geometry is ineligible for copyright and therefore in the public domain, because it consists entirely of information that is common property and contains no original authorship.
Heptagon
Heptagon

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current13:38, 7 January 2015Thumbnail for version as of 13:38, 7 January 2015256 × 256 (364 bytes)Sarang (talk | contribs){{Information |Description=Example for viewBox and overwriting it |Source={{Own}} |Date=2015-01-07 |Author={{Ut|Sarang}} }}

The following page uses this file:

Metadata