Importing an SVG with the new Widget

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9416
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Importing an SVG with the new Widget

Post by richmond62 » Sat Mar 12, 2016 6:09 pm

Well, as not all of us have Adobe Illustrator [ http://lessons.livecode.com/m/33498/l/3 ... -extension ]

I thought I would put together a similar "Show-Me" thing using Inkscape [ https://inkscape.org/en/ ]:

Open or create your shape in Inkscape:
Ink1.png
Select ALL the layers:
Ink2.png
Make sure it is a compound path:
Ink3.png
Last edited by richmond62 on Sat Mar 12, 2016 6:16 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9416
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing an SVG with the new Widget

Post by richmond62 » Sat Mar 12, 2016 6:12 pm

Save under a different name:
Ink4.png
Notice how the image has changed.

Open the new image in a text editor:
Ink5.gif
Get the d="..." data
Ink6.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9416
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing an SVG with the new Widget

Post by richmond62 » Sat Mar 12, 2016 6:14 pm

Paste into iconPath field:
Ink7.gif
Here's a ZIP file with the resultant stack and the original SVG file so you can play around
with this yourself:
Packet.zip
(49.83 KiB) Downloaded 253 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9416
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Importing an SVG with the new Widget

Post by richmond62 » Sat Mar 12, 2016 8:23 pm

Unfortunately the imported image is not exactly the same as the original SVG image,
and until that happens SVG import is a fudge.
result.png

Post Reply

Return to “Multimedia”