Difference between revisions of User:Divenal/sandbox

Divenal (talk | contribs)
No edit summary
Divenal (talk | contribs)
Updates to reflected new image size of 256x256
Line 12: Line 12:
----
----


[[File:rgfocus.svg|250px|thumb|right]]
[[File:rgfocus.svg|thumb|right]]


This is a quick svg hack-up of the test page on [[Varakari's_Vision_Log_Tool]]. My intention was to be able to display it on my smartphone for measurement, but should work on any browser.
This is a quick svg hack-up of the test page on [[Varakari's_Vision_Log_Tool]]. My intention was to be able to display it on my smartphone for measurement, but should work on any browser.
Line 18: Line 18:
The image itself is svg, and so infinitely scalable. But the wiki tends to generate it as a png. So if you need to resize it, it's better to do it as svg rather than zooming in or out of the png.  One simple way to do that is to add a reference to the image from your own wiki page, and adjust the size. Then the wiki will generate a png at that size, and you can download it locally.
The image itself is svg, and so infinitely scalable. But the wiki tends to generate it as a png. So if you need to resize it, it's better to do it as svg rather than zooming in or out of the png.  One simple way to do that is to add a reference to the image from your own wiki page, and adjust the size. Then the wiki will generate a png at that size, and you can download it locally.


To do so, just add a reference of the form  <nowiki>[[File:rgfocus.svg|250px]]</nowiki>.  The 250px is the image size, and you can set that to whatever you want. There are various other options that can go in - see https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Images
To do so, just add a reference of the form  <nowiki>[[File:rgfocus.svg|512px]]</nowiki>.  The 512px is the image size you want, and you can set that to whatever you want. The wiki should render the svg to a bitmap of that size. (The original is 256px.) There are various other options that can go in - see https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Images


If you click on the image, it will take to the page about the file. Clicking again should present the raw svg to the browser. You can use the browser's view-source option to see the (trivial) svg that creates the image. It should be fairly obvious how it works. The only slightly non-trivial thing is the <nowiki><g ...></nowiki> stuff. That just moves the origin to the centre of the canvas and sets the default text anchor, so that all the entities have an x-co-ord of 0. Just saves having to repeat stuff on every line.
If you click on the image, it will take to the page about the file. Clicking again should present the raw svg to the browser. You can use the browser's view-source option to see the (trivial) svg that creates the image. It should be fairly obvious how it works. The only slightly non-trivial thing is the <nowiki><g ...></nowiki> stuff. That just moves the origin to the centre of the canvas and sets the default text anchor, so that all the entities have an x-co-ord of 0. Just saves having to repeat stuff on every line.


Do feel free to improve it.
Do feel free to improve it.