[Gtk-sharp-list] GTK# and PixbufAnimation iteration.

MrFreeman biggestsonicfan at gmail.com
Fri Feb 11 13:59:32 EST 2011


I'm having a problem using Gdk.PixbufAnimationIter of a PixbufAnimation. The
code goes something like this:

Gdk.PixbufAnimation animation = new
Gdk.PixbufAnimation(System.IO.Path.Combine([filepath], [filename]));
Gdk.PixbufAnimationIter iter = animation.GetIter([Current Time as IntPtr]);

Here's what I read about PixbufAnimation.Iter:

"start_time is the start time specified as a float as output from the Python
time.time() function. start_time marks the beginning of the animation

GTK# does not have the time.time() function, and I have tried the following:

long StartTime = DateTime.Now.Millisecond;
IntPtr SysTime = new IntPtr (&StartTime);
Gdk.PixbufAnimationIter iter = animation.GetIter(SysTime);

But that does not seem to retrieve any time consistently. The numbers
generated from this seem very random, and are probably pulling from the
wrong address in memory (only a guess, don't quote me on that).

I have also read this from another documentation of PixbufAnimation:

"As a shortcut, if start_time is NULL, the result of g_get_current_time()
will be used automatically."

However, the compiler refuses to allow a NULL value for the IntPtr.

I have also read that the "Current Time" is only used if you are trying to
mess with the animation, such as making the animation display faster or

Can anyone out there help me?
View this message in context: http://mono.1490590.n4.nabble.com/GTK-and-PixbufAnimation-iteration-tp3301803p3301803.html
Sent from the Mono - Gtk# mailing list archive at Nabble.com.

More information about the Gtk-sharp-list mailing list