SVG to image

Brian Milby brian at milby7.com
Mon Sep 17 00:06:43 EDT 2018


Jonathan's stack is very cool.  I wasn't minimizing the work in the engine
though, just pointing out that particular images would need to be tested to
see which method provides the needed results.  There can be significant
differences in the object size depending on which version is used (path,
full SVG, compiled SVG) - and it isn't always what you would expect.  Most
of the time, the compiled SVG is the smallest and since support is built
into the engine it would be a good choice where the particular image
supports it.

I'll need to take your stack/widget and see how what it generates compares
to conversions from the source svg file (for the Font Awesome stuff).
Since you are adding back information that was stripped when converting to
an icon, my guess is that the results should be pretty much the same.

@Klaus - have you thought about just using the svg icon widget instead of a
button?  I've done that in my SvgIconTool stack and used a behavior to make
it behave somewhat like a button would (hilite on mouseDown, etc.).

Brian

On Sun, Sep 16, 2018 at 7:25 PM hh via use-livecode <
use-livecode at lists.runrev.com> wrote:

> 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".
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list