SVG powered images

hh hh at hyperhh.de
Fri May 12 05:24:40 EDT 2017


> 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).




More information about the use-livecode mailing list