So I have an SVG image that downloads from the web and displays in a web viewer.
(Can't use container fields for SVG as far as I am able to determine).
It displays all right but in a huge size. So how do I scale it to a size lets say 300 x 300 pixels. Basically this is an image of a country's flag and it downloads full size.
The URL is : https://restcountries.eu/data/can.svg
So can someone pls help with code that will scale the full size image down to required size.
You could embed it in a bit of HTML to define the size of the area you show it inside.
Not sure if this is what you're asking, but you could also write a little code to do image scaling. Lots of examples of that. You could use the @MonkeybreadSoftware's plug-in to run its "Shell" command to run that code.
Well, I think Kevin wanted to show the SVG in a web view scaled down.
Maybe just put it in a container and tell the container to scale to fit?
Thanks Christian and OliverBarrett:
I tried this - does not work.
<img width = 300 src = Countries::flagURL>
Where Countries::flagURL is a field containing the URL for the flag and changes with each record.
Any help appreciated.
You must be much more precision. extra spaces, missing quotes and a field name won't fly.
The HTML must contain the field value, not the field name.
Please ty again.
Got it. Thanks to encouragement from Christian
For convenience of others just posting the correct code which worked for me.
<img width = 300 src=country></img>
"country" ; Countries::flagURL)
Now the flag image perfectly resizes and fits in the web viewer.
Please replace with
<img width=300 src="country">
no end tag for img and no spaces around = and URL in quotes may help.