Crea  Modifica  FrontPage  Indici  Cerca  Ultime modifiche  History  RSS  Login


class Gdk::PixbufAnimationIter

A Gdk::PixbufAnimationIter provides the necessary functionality to display an animation.

Instance Methods

advance(current_time_sec = nil, current_time_usec = nil)
Possibly advances an animation to a new frame. Chooses the frame based on the start time passed to Gdk::PixbufAnimation#get_iter. current_time would normally come from GLib.current_time, and must be greater than or equal to the time passed to Gdk::PixbufAnimation#get_iter, and must increase or remain unchanged each time Gdk::PixbufAnimationIter#pixbuf is called. That is, you can't go backward in time; animations only play forward. As a shortcut, pass nil for the current time and GLib.current_time will be invoked on your behalf. So you only need to explicitly pass current_time if you're doing something odd like playing the animation at double speed. If this method returns false, there's no need to update the animation display, assuming the display had been rendered prior to advancing; if true, you need to call Gdk::PixbufAnimationIter#pixbuf and update the display with the new pixbuf.
  • current_time_sec : current time sec
  • current_time_usec : current time usec (milliseconds)
  • Returns : true if the image may need updating
Gets the number of milliseconds the current pixbuf should be displayed, or -1 if the current pixbuf should be displayed forever. GLib.timeout_add() conveniently takes a timeout in milliseconds, so you can use a timeout to schedule the next update.
  • Returns: delay time in milliseconds (thousandths of a second)
Used to determine how to respond to the area_updated signal on Gdk::PixbufLoader when loading an animation. area_updated is emitted for an area of the frame currently streaming in to the loader. So if you're on the currently loading frame, you need to redraw the screen for the updated area.
  • Returns: true if the frame we're on is partially loaded, or the last frame
Gets the current Gdk::Pixbuf which should be displayed; the pixbuf will be the same size as the animation itself (Gdk::PixbufAnimation#width(), Gdk::PixbufAnimation#height). This pixbuf should be displayed for Gdk::PixbufAnimationIter#delay_time milliseconds. The caller of this method does not own a reference to the returned pixbuf; the returned pixbuf will become invalid when the iterator advances to the next frame, which may happen anytime you call Gdk::PixbufAnimationIter#advance. Copy the pixbuf to keep it (don't just add a reference), as it may get recycled as you advance the iterator.
Ultima modifica:2005/11/17 02:43:41
Parola chiave:
Referenze:[Gdk::PixbufAnimation] [Gdk::PixbufAnimationIter] [Gdk::PixbufLoader]