E
E
EmachinesDIMA2015-05-31 20:00:29
Programming
EmachinesDIMA, 2015-05-31 20:00:29

How to organize a looped change of pictures?

How to organize I/O switch model? I pressed the button - the picture changed. Again clicked on it - back to the original. and so on ad infinitum.
ps with the first I coped. how to do the opposite? algorithms? Cycles? any ideas!
How to check the status of which picture is currently active?
if ( Image.Source("uri") )
???

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valery Ryaboshapko, 2015-05-31
@EmachinesDIMA

The switch is an object, its state is the boolean parameter isOn. True - enabled, False - disabled. The object also has a toggle() method that does stupidly:
and then calls a method that redraws the picture. The method of drawing a picture is elementary.

M
mikhail_404, 2015-06-01
@mikhail_404

For the general case, you can use a circular queue or similar circular containers. Looked at the first element and at the end of it. Everything is trite and simple!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question