Package: gdk-pixbuf
Function gdk-pixbuf:pixbuf-animation-iter
Lambda Listgdk-pixbuf:pixbuf-animation-iter (animation time) ArgumentsReturn ValueThe gdk-pixbuf:pixbuf-animation-iter object with the iterator to move over the animation. Details
Get an iterator for displaying an animation.
The iterator provides the frames that should be displayed at a given time. The time argument would normally come from the g_get_current_time() function, and marks the beginning of animation playback. After creating an iterator, you should immediately display the pixbuf returned by the gdk-pixbuf:pixbuf-animation-iter-pixbuf function. Then, you should install a timeout, with the g:timeout-add function, or by some other mechanism ensure that you will update the image after gdk-pixbuf:pixbuf-animation-iter-delay-time milliseconds. Each time the image is updated, you should reinstall the timeout with the new, possibly changed delay time. As a shortcut, if the time argument is nil, the result of the g_get_current_time() function will be used automatically. To update the image, that is possibly change the result of the gdk-pixbuf:pixbuf-animation-iter-pixbuf function to a new frame of the animation, call the gdk-pixbuf:pixbuf-animation-iter-advance function. If you are using the gdk-pixbuf:pixbuf-loader API, in addition to updating the image after the delay time, you should also update it whenever you receive the "area-updated" signal and the gdk-pixbuf:pixbuf-animation-iter-on-currently-loading-frame function returns true. In this case, the frame currently being fed into the loader has received new data, so needs to be refreshed. The delay time for a frame may also be modified after an "area-updated" signal, for example, if the delay time for a frame is encoded in the data after the frame itself. So your timeout should be reinstalled after any "area-updated" signal. A delay time of -1 is possible, indicating 'infinite'. | See also |
#2024-11-11