Animated Gifs on Other Cards

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

Animated Gifs on Other Cards

Sannyasin Brahmanathaswami
if we import an animated gif into a card called "image-resources" which might be e.g. card 3. with repeat set to -1… i.e it is running continuously…

When are on Card 1… is that GIF still running and taking up CPU cycles even though it is effectively "hidden" by virtue of being on Card 3?

OR

is best practice to always stop, start and stop them programmatically so that, when not actually shown, they are not repeating?

Use case would be to use an animated give as the icon for a button… if you set the icon ID of  a button on cd 1 that is an animated running GIF stored on card 3  it works, but I'm concerned about any performance degradation that these might have if left repeating "behind the scenes"

perhaps there are none, if not, that would keep life simple and you don't have to commands to stop and start the GIF every time you want to show it.

BR



_______________________________________________
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: Animated Gifs on Other Cards

J. Landman Gay
On 1/2/17 9:23 PM, Sannyasin Brahmanathaswami wrote:
> When are on Card 1… is that GIF still running and taking up CPU
> cycles even though it is effectively "hidden" by virtue of being on
> Card 3?

I don't believe so, LC only draws what is on the current card.
--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.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: Animated Gifs on Other Cards

Peter Bogdanoff
I suppose one way to test, is to go to the card where the GIF is running—does it start at the beginning every time you go there?

pb

On Jan 3, 2017, at 11:33 AM, J. Landman Gay <[hidden email]> wrote:

> On 1/2/17 9:23 PM, Sannyasin Brahmanathaswami wrote:
>> When are on Card 1… is that GIF still running and taking up CPU
>> cycles even though it is effectively "hidden" by virtue of being on
>> Card 3?
>
> I don't believe so, LC only draws what is on the current card.
> --
> Jacqueline Landman Gay         |     [hidden email]
> HyperActive Software           |     http://www.hyperactivesw.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
Reply | Threaded
Open this post in threaded view
|

Re: Animated Gifs on Other Cards

Richmond Mathewson-2
In reply to this post by J. Landman Gay
If a GIF is running on another card I really wonder how you determine that.

Richmond.

On 1/3/17 9:33 pm, J. Landman Gay wrote:
> On 1/2/17 9:23 PM, Sannyasin Brahmanathaswami wrote:
>> When are on Card 1… is that GIF still running and taking up CPU
>> cycles even though it is effectively "hidden" by virtue of being on
>> Card 3?
>
> I don't believe so, LC only draws what is on the current card.

_______________________________________________
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: Animated Gifs on Other Cards

Richmond Mathewson-2
In reply to this post by Peter Bogdanoff


On 1/3/17 9:47 pm, Peter Bogdanoff wrote:
> I suppose one way to test, is to go to the card where the GIF is running—does it start at the beginning every time you go there?

I'm not sure if that would work: as if you left a card while a GIF was
in mid-cycle it might be paused at that frame until you returned to that
card.

Richmond.

>
> pb
>
> On Jan 3, 2017, at 11:33 AM, J. Landman Gay <[hidden email]> wrote:
>
>> On 1/2/17 9:23 PM, Sannyasin Brahmanathaswami wrote:
>>> When are on Card 1… is that GIF still running and taking up CPU
>>> cycles even though it is effectively "hidden" by virtue of being on
>>> Card 3?
>> I don't believe so, LC only draws what is on the current card.
>> --
>> Jacqueline Landman Gay         |     [hidden email]
>> HyperActive Software           |     http://www.hyperactivesw.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


_______________________________________________
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: Animated Gifs on Other Cards

Richard Gaskin
In reply to this post by Richmond Mathewson-2
Richmond Mathewson wrote:

 > If a GIF is running on another card I really wonder how you determine
 > that.

Put an animated GIF on a card, and this in the stack script:

on idle
    put the currentFrame of img 1 of cd 1
end idle

Then go to another card.

Here, a quick test confirms Jacque's hunch; the Message Box only updates
when I'm on the card with the GIF.

--
  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: Animated Gifs on Other Cards

J. Landman Gay
On 1/3/17 2:07 PM, Richard Gaskin wrote:

> Richmond Mathewson wrote:
>
>> If a GIF is running on another card I really wonder how you determine
>> that.
>
> Put an animated GIF on a card, and this in the stack script:
>
> on idle
>    put the currentFrame of img 1 of cd 1
> end idle
>
> Then go to another card.
>
> Here, a quick test confirms Jacque's hunch; the Message Box only updates
> when I'm on the card with the GIF.
>

Clever. So I got curious, what would happen if the stack is moved
offscreen? Result: it still updates. What happens if you hide the image?
Result: it doesn't update.

I kind of knew that last one already, I've hidden "busy" gifs before
without any repercussions.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.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
hh
Reply | Threaded
Open this post in threaded view
|

Re: Animated Gifs on Other Cards

hh
In reply to this post by Sannyasin Brahmanathaswami
Yet another option.

One may use for the 'it-pauses-until-coming-back'-test a gif that
counts in seconds from 0 up to 100:

giphy.com/gifs/TCJTqRAxRbhGU   (repeatCount=-1)

Note. If you go to a different window (of LC or not), leaving the
running gif on the top card of its window, then the gif keeps going
on, whether hidden by another window or not.


_______________________________________________
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: Animated Gifs on Other Cards

Bob Sneidar-2
In reply to this post by J. Landman Gay
Makes sense. There really is no "off screen" to the modern computer.
On Jan 3, 2017, at 13:03 , J. Landman Gay <[hidden email]<mailto:[hidden email]>> wrote:

Clever. So I got curious, what would happen if the stack is moved offscreen? Result: it still updates. What happens if you hide the image? Result: it doesn't update.

I kind of knew that last one already, I've hidden "busy" gifs before without any repercussions.

--
Jacqueline Landman Gay         |     [hidden email]<mailto:[hidden email]>
HyperActive Software           |     http://www.hyperactivesw.com<http://www.hyperactivesw.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: Animated Gifs on Other Cards

Sannyasin Brahmanathaswami
Good input… off screen or on top card of open window behind the top stack: GIF is still running…

Given that we might be instantiating the appearance of these GIFs (icons of buttons) "here and there and everywhere" via some low level back script or lib that was brought into the msg path with start using… it makes sense then to hide it as a "best practice" … with a generalized behavior… this would avert the need for additional "sensor code" to be have to check if the window was open but behind etc.  

I haven't tried it recently, but I once (years ago) had a number of animated GIFs on my desktop (mac)… and the Finder ran slow as molasses.  Put them all into a folder, Finder became responsive again.

This got me to thinking the other day, if they slow down LC performance when running.

The other term use case beside brief appearance of indicators that come and go,  would be even more intensive: in this case we know what is happening, they are all there, running on top: set 4-8 animated GIF figures to start moving around on the screen, with some voice over story line… will this "die" on a cheap Android phone? TBD

Of course we can benchmark this now that we know when the GIF still runs or not.

BR

------
 
Jacque wrote:
    I've hidden "busy" gifs before without any repercussions.
   
   

_______________________________________________
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
hh
Reply | Threaded
Open this post in threaded view
|

Re: Animated Gifs on Other Cards

hh
In reply to this post by Sannyasin Brahmanathaswami
TMHO it is much better to animate gifs by an own handler (send in
'regular' time intervals, for example every next full second).
Only by that you have full control on the animation speed on different
hardware. I have a lot of gifs whose speed is set to "fastest", not this
perfect on fast machines, only fine old PowerPCs.

And by setting ONE "check" (variable) you can start/stop
the animation:
= stop at once/ after finishing the loop/ after a certain time amount
= don't stop but pause only
= stop forever after a certain number of repeats
= pause for a certain amount of time
= pause while the suspended
= stopping if the cycle becomes too slow
etc ...
As usual this may all be done by one handler for each gif or
by ONE handler up in the message hierarchy for several gifs.

_______________________________________________
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