[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

a possible replacement for cw_animate and xinteranimate



Hi ,
    I put a message on the news group a couple of weeks ago about doing
composite animations - animations which have more than one thing going
on - the original message explains the problem. I received two
suggestions, but neither was really what I wanted. David Fanning
suggested displaying the images for each frame, i.e. don't use pixmaps,
but this was not fast enough and Liam Gumley's frames programs weren't
entirely what I wanted. So I wrote my own animation routines. As I wrote
it, I tried to make it very general and the finished product, I think,
would probably would be quite useful to people.
    The program has a wodget based front end which to all intents and
purposes looks very much like the front end of xinteranimate. I don't
know how xinteranimate is written - I couldn't understand the code - but
I've written my version using the timer keyword so the program spends
little time in the event loop. The widget program, though, has no idea
what it is drawing - it is totally general. The widget program is
calling object methods - and it is this which means you can have a great
deal of control in creating users defined animations. I won't bother
going into specifics, but I'll just give you the benefits I can
envisage.


   * In the objects you define elements in the animation, such as an
     animation of a ctscan, a second animation of the heart, some axes,
     a colour bar etc. You then determine whether these elements are
     fixed - the axes, the colour bar, or moving - the two animations.
     For each element you must also define its position in the frame.
     The standard object then does the rest really.
   * Because I am not saving the entire window, and am allocating
     pixmaps for each element and then using the positions in the
     device, copy=[] to recreate the frames, any black space is not
     taking up memory, also fixed items only have one pixmap - there is
     only one colour bar.
   * Essentially you could create the object to do anything, and I think
     that this is probably the greatest benefit - that you, the
     programmer have complete control. You can even add to the front end
     for specific animations, if the user wanted to enter more
     information

    The program is not yet ready - it works and all the points I have
described are in place, but there is currently no error checking and the
front end needs a few alterations, like messages to tell you what it is
doing etc.. - but I would really appreciate it if people commented. If
you think that this program could be of use to you then I would be very
grateful if you could e-mail me direct or post a reply on the news
group, with perhaps suggestions of features you might like to see, and
what you might use it for.

    At the moment the program only reads in ascii text but it will soon
be able to read in byte images as well. With ascii text the program
automatically works the image sizes, but is there any way of doing this
with byte data, because with ascii text the data is presented like the
array with carriage returns at the end of each row and space separators
between each frame, but I am not sure about byte images. Again, if
anyone can help, that would be great.

        I've tried to explain the program as best I can, I hope it's not
too garbled..thanks in advance for any replies I get.

                            cheers,
                                Phil Aldis