SVG to image

hh hh at hyperhh.de
Sun Sep 16 20:25:17 EDT 2018


BoundingBox widget / Compile iconPath to image
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The real point that came up here is how to get the bounding
box of an SVG path that is used as iconPath of the svgIcon
widget. With that it is simple to prepare the path as input
for drawingSVGcompile.

I wrote this evening a widget that computes the bounding box.

A demo stack, incl. an installer button for this "BB widget",
shows the 35 lines of script (incl. the SVG template) needed
to do the steps for "compile iconPath to image" described
above. See

http://livecodeshare.runrev.com/stack/900

Conversion via JavaScript is of course (currently) better as
drawingSVGCompile. Jonathan Lynch showed this technique to
the community before a year or so, and there are some stacks
on "Sample Stacks/revOnline" that use this technique.

DrawingSVGCompile is (as Mark wrote) still beta.
On the other hand it does a pretty good job with complicated
but not-too-complex SVGs, e.g. the "postscript-tiger".




More information about the use-livecode mailing list