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

jonathandlynch at gmail.com jonathandlynch at gmail.com
Wed May 10 14:55:10 EDT 2017


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



More information about the use-livecode mailing list