Re: SVG powered images

2017-05-13 Thread Jonathan Lynch via use-livecode
I feel like HH has an important point - this method uses a lot of processor power. We should minimize the burden on the processor (small animation, efficient JavaScript) and make sure our target users will consistently have the processing power to handle this kind of animation. Sent from my iP

Re: SVG powered images

2017-05-13 Thread hh via use-livecode
@Klaus I tested the svg-to-png conversion using both revBrowser and browser widget on Mac 10.12.4. This works. It doesn't work on Mac 10.10. (probably also Mac 10.11). This is caused by webkit which LC uses on Mac. Where it runs, taking frames from an svg animation or from a video is "stuttering"

Re: SVG powered images

2017-05-13 Thread Jonathan Lynch via use-livecode
For svg animation, it seems like it would be more efficient to let the animation play in the widget and just periodically export a frame, rather than rewrite the svg every time. Sent from my iPhone > On May 13, 2017, at 6:50 AM, Klaus major-k via use-livecode > wrote: > > Addition, the ani

Re: SVG powered images

2017-05-13 Thread Klaus major-k via use-livecode
Addition, the animated SVG is not displayed in any browser widget at all!? Best Klaus -- Klaus Major http://www.major-k.de kl...@major-k.de ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe a

Re: SVG powered images

2017-05-13 Thread Klaus major-k via use-livecode
message: > > Klaus Major wrote about running animated svg: >> not when viewed in Safari on a Mac! > > Macs always store a surprise or two! :D > Check if this step by step recipe works > in a Mac: > > 1) Download most recent version of Jonathan Lynch's stack: &g

SVG powered images

2017-05-12 Thread Alejandro Tejada via use-livecode
tep by step recipe works in a Mac: 1) Download most recent version of Jonathan Lynch's stack: http://livecodeshare.runrev.com/stack/830/SVG-Powered-Images 2) Download this animated svg: https://openclipart.org/detail/230261/gearanimation02-remix This mechanical gears animation is better for

Re: SVG powered images

2017-05-12 Thread Jonathan Lynch via use-livecode
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 wrote: >> Jonatha

Re: SVG powered images

2017-05-12 Thread Jonathan Lynch via use-livecode
How does it look? Sent from my iPhone > On May 11, 2017, at 10:15 PM, Alejandro Tejada via use-livecode > wrote: > > This mousedown script shows a rough preview > of the SVG animation if you put it into the image: > > on mousedown > put the id of me into tID > repeat while the mouse is down

Re: SVG powered images

2017-05-12 Thread Jonathan Lynch via use-livecode
Hey guys - I figured out a solution for that bug I had previously written a hack for. I use the image.onload handler in the JavaScript for this. It works consistently now. I just had to get my order of events correct in the JavaScript. So please check out the new version. J Sent from my iPhon

Re: SVG powered images

2017-05-12 Thread Klaus major-k via use-livecode
Hi Al, > Am 12.05.2017 um 03:31 schrieb Alejandro Tejada via use-livecode > : > > ... > By the way, open and resize an animated SVG like this: > https://openclipart.org/download/188969/WalkingMan.svg > > Notice how it changes to different animation frames > each time that you resize the image.

Re: SVG powered images

2017-05-12 Thread hh via use-livecode
> 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 = funct

SVG powered images

2017-05-11 Thread Alejandro Tejada via use-livecode
This mousedown script shows a rough preview of the SVG animation if you put it into the image: on mousedown put the id of me into tID repeat while the mouse is down send "processSVG tID" to widget "SVGBrowser1" end repeat end mousedown Al

Re: SVG powered images

2017-05-11 Thread Jonathan Lynch via use-livecode
To do an animation it would need a continuous but interruptible callback loop - with delayed sending for the next iteration after the previous iteration has finished. I think it is doable. Sent from my iPhone > On May 11, 2017, at 9:31 PM, Alejandro Tejada via use-livecode > wrote: > > Hi H

Re: SVG powered images

2017-05-11 Thread Jonathan Lynch via use-livecode
I tried splitting up the chain like this. Even sending in 10 milliseconds did not work. The best test is to close LiveCode then open it back up and run the stack. If resizing one of the images works the first time, then it is good. However, delaying the command to send for the image does not wo

Re: SVG powered images

2017-05-11 Thread Alejandro Tejada via use-livecode
My mistake, that previous message should read: I tried to apply your script, but just get an error. Surely, it's because I do NOT followed correctly your instructions On Thu, May 11, 2017 at 9:31 PM, Alejandro Tejada wrote: > Hi Hermann, > > I tried to apply your script, but just get an error. >

SVG powered images

2017-05-11 Thread Alejandro Tejada via use-livecode
Hi Hermann, I tried to apply your script, but just get an error. Surely, it's because I do follow correctly your instructions: > You could try to leave out the "liveCode.JStoLC" from the html. > Instead send the conversion 'delayed", 1 tick should be enough: local svgb="SVGBrowser1" send "proce

Re: SVG powered images

2017-05-11 Thread hh via use-livecode
You could try to leave out the "liveCode.JStoLC" from the html. Instead send the conversion 'delayed", 1 tick should be enough: local svgb="SVGBrowser1" send "processSVG tID" to widget svgb put "var dd=document.getElementById('canvas1');" & \ "liveCode.JStoLC(dd.toDataURL(),tID)") into js

Re: SVG powered images

2017-05-11 Thread Jonathan Lynch via use-livecode
Did some more research. Yup - the image renders in the canvas asynchronously. So, on first load it is exporting the canvas image before that image is rendered. Going to see if I can add an event handler that is triggered when the canvas is finished. Thanks for the tip :) Sent from my iPhone

Re: SVG powered images

2017-05-11 Thread Jonathan Lynch via use-livecode
Ah Yes - the svg data is cached. That would explain why it must happen for every image. Thanks Hermann. I will tinker some more. Sent from my iPhone On May 11, 2017, at 5:52 PM, hh via use-livecode wrote: >> JL wrote: >> If it were from that, then we could not switch back and forth >> betw

Re: SVG powered images

2017-05-11 Thread hh via use-livecode
> JL wrote: > If it were from that, then we could not switch back and forth > between resizing different images. It would show the output of > the previous image processed. But that does not happen. > I thought I chained the commands linearly, but I will check > that again. I didn't say the second

Re: SVG powered images

2017-05-11 Thread Jonathan Lynch via use-livecode
lly cool with webgl animations. > > Sent from my iPhone > >> On May 11, 2017, at 4:32 PM, Alejandro Tejada via use-livecode >> wrote: >> >> Hi Jonathan, >> >> This stack opens up a lot of new possibilities. >> Many thanks again for sharing! :D >&g

Re: SVG powered images

2017-05-11 Thread Jonathan Lynch via use-livecode
use-livecode > wrote: > > Hi Jonathan, > > This stack opens up a lot of new possibilities. > Many thanks again for sharing! :D > http://livecodeshare.runrev.com/stack/830/SVG-Powered-Images > > If we modify SVG file on the custom property mysvgdata > Does images updates

Re: SVG powered images

2017-05-11 Thread hh via use-livecode
Jonathan, nice idea and clever work, congratulations. Two remarks: (1) Actually the svg-to-png conversion method toDataUrl() yields at most a 96 dpi image. So, if you scale the svg once to an image of twice the maximum size you will need, then set the resizequality of that image to "best" and s

SVG powered images

2017-05-11 Thread Alejandro Tejada via use-livecode
Hi Jonathan, This stack opens up a lot of new possibilities. Many thanks again for sharing! :D http://livecodeshare.runrev.com/stack/830/SVG-Powered-Images If we modify SVG file on the custom property mysvgdata Does images updates automatically? How could we load an animated svg and play it

SVG powered images

2017-05-11 Thread Jonathan Lynch via use-livecode
Hi everyone, I just uploaded version 1 of a stack called "SVG Powered Images" onto livecodeshare. Just go to livecodeshare.runrev.com and sort for the newest upload. This stack makes it practical to use fully scalable SVG files in your stack. It is not as good as having a full SVG o