Skip to content

ImageFrameDelay

Narta Xaymar Dirks edited this page Oct 28, 2026 · 2 revisions

ImageFrameDelay

ImageFrameDelay:Int32 image:Int32, frame:Int32
Parameter Mode Type Default Description
image In Int32 required The image to ask about.
frame In Int32 required The frame, from 0.

Returns: The time in milliseconds, or 0 for an image that is not from an animated picture or a frame that it does not have.

Description

Says how long a frame of an animated picture lasts, in milliseconds, so that a program can step through the frames at the speed that the file asks for. LoadAnimImage with a frame size of 0 loads GIF, animated WebP and animated AVIF files this way. A frame that the file gives no time (or 0) lasts 100 milliseconds, like in web browsers.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
anim = LoadAnimImage("spinner.gif", 0, 0, 0, 0)
frame = 0 : next_change = MilliSecs() + ImageFrameDelay(anim, 0)
While Not KeyHit(1)
	If MilliSecs() >= next_change Then
		frame = (frame + 1) Mod ImageFrames(anim)
		next_change = MilliSecs() + ImageFrameDelay(anim, frame)
	EndIf
	Cls
	DrawImage anim, 160, 120, frame
	Flip
Wend

This is a BlitzLLVM extension: the originals cannot load animated pictures.

Related Commands

ImageBuffer, ImageFrames, ImageHeight, ImageReady 〔BlitzLLVM〕, ImageRectCollide, ImageRectOverlap, ImageWidth, ImageXHandle

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally