SVG powered images

jonathandlynch at gmail.com jonathandlynch at gmail.com
Fri May 12 08:44:20 EDT 2017


Hi Hermann - I just got this message - I arrived at the same onload conclusion.

I get it now, but the way the JavaScript had to be ordered seemed counterintuitive at first.

Thanks for your help on this :)

Sent from my iPhone

On May 12, 2017, at 5:24 AM, hh via use-livecode <use-livecode at lists.runrev.com> wrote:

>> Jonathan L. wrote:
>> However, delaying the command to send for the image does not work
>> for the first resizing of the image in this scenario.
> 
> It works. I have it running here with the browser widget. I finally
> got it using an "onload" for the image and for the window.
> 
> ...
> image1.onload = function() {
>   ctx.drawImage(image1,0,0,twidth,theight);
> }
> ...
> window.onload=processsvg(twidth,theight,tID);
> 
> After that sending toDataURL() to the canvas delayed by 1 tick has here
> no misfunction.
> 
> I wrote it also for a revBrowserInstance what can be used in LC 6/7/8/9 
> but on Mac only, because linux has no revBroser working and windows only
> one that doesn't support Canvas2d. This is essentially the same technique
> (but doesn't use a javascriptHandler).
> 
> I put this LC 6/7/8/9 version on livecodeshare/"sample stacks" so that
> your browser widget version is still unique ...
> 
> I have also a fast method, runs with 30 fps, for taking PNG-frames from a
> video, so that converting an SVG animation to PNGs is no problem (though
> I can't see any sense in doing that).
> 
> _______________________________________________
> 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