Using a hidden browser widget to create a perfectly scalable LC control

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Using a hidden browser widget to create a perfectly scalable LC control

Bob Sneidar via use-livecode
I just did an experiment. It appears to be possible to have an image object that stores svg data in a custom property. It connects to a hidden browser widget to do the following:

- squirt the svg data into an HTML canvas
- resize the svg image using the setscale() method
- export the resized image (with transparency) to a variable
- pass that variable back to LC
- set the image content of the image to that variable

The entire operation took 4 milliseconds for a moderate sized svg image.

This means we could have svg-quality resizable images, for responsive design scripts.

I will try to create a browser widget with all of the necessary scripts in that one object, so you can import SVG files at will, display them in an auto-generated image, and painlessly resize the image at will.

To do that, one would have to include the browser widget in a hidden place on any stacks that use these pseudo SVG images.

Please let me know if you have any suggestions. I think I can get the stack up on livecodeshare in the next couple days.

Sent from my iPhone
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Using a hidden browser widget to create a perfectly scalable LC control

Bob Sneidar via use-livecode
Sweet!


> On May 10, 2017, at 11:55 , Jonathan Lynch via use-livecode <[hidden email]> wrote:
>
> I just did an experiment. It appears to be possible to have an image object that stores svg data in a custom property.
<snip>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Using a hidden browser widget to create a perfectly scalable LC control

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
jonathandlynch wrote:

 > I just did an experiment. It appears to be possible to have an image
 > object that stores svg data in a custom property. It connects to a
 > hidden browser widget to do the following:
 >
 > - squirt the svg data into an HTML canvas
 > - resize the svg image using the setscale() method
 > - export the resized image (with transparency) to a variable
 > - pass that variable back to LC
 > - set the image content of the image to that variable
 >
 > The entire operation took 4 milliseconds for a moderate sized svg
 > image.
 >
 > This means we could have svg-quality resizable images, for responsive
 > design scripts.

Clever workaround, but looking at the bigger picture of platform
adoption, do we really want to tell new users that to display SVGs you
need to embed an entire browser application inside your application?

What is the purpose of the existing SVG widget if not to render SVGs?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Using a hidden browser widget to create a perfectly scalable LC control

Bob Sneidar via use-livecode
I agree - but I need fully scalable controls for Augmented Earth now, not later, and the current SVG objects are not complete.

My app uses the browser widget anyway, so not worried about the overhead.

Sent from my iPhone

> On May 11, 2017, at 10:49 AM, Richard Gaskin via use-livecode <[hidden email]> wrote:
>
> jonathandlynch wrote:
>
> > I just did an experiment. It appears to be possible to have an image
> > object that stores svg data in a custom property. It connects to a
> > hidden browser widget to do the following:
> >
> > - squirt the svg data into an HTML canvas
> > - resize the svg image using the setscale() method
> > - export the resized image (with transparency) to a variable
> > - pass that variable back to LC
> > - set the image content of the image to that variable
> >
> > The entire operation took 4 milliseconds for a moderate sized svg
> > image.
> >
> > This means we could have svg-quality resizable images, for responsive
> > design scripts.
>
> Clever workaround, but looking at the bigger picture of platform adoption, do we really want to tell new users that to display SVGs you need to embed an entire browser application inside your application?
>
> What is the purpose of the existing SVG widget if not to render SVGs?
>
> --
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> [hidden email]                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode