Hello,
I’ve been following the forum thread on displaying an animated GIF on a Canvas (Animated Gif on Canvas) and decided to experiment by building a simple example project.
As a first step, I attempted to count the number of frames in the GIF using the code below. However, the result is always zero on both Windows and Linux (Raspberry Pi) using Xojo 2025 r2.
Am I missing something or doing something incorrectly?
I’ve attached both the GIF file and my example Xojo project for reference.
Thanks in advance for any insights!
Sub Pressed() Handles Pressed
Dim f as FolderItem = FolderItem.ShowOpenFileDialog("image/gif")
If f <> Nil Then
Var pic as Picture = Picture.Open(f)
TextArea1.Text = "Frames: " + pic.ImageCount.ToString
End If
End Sub

AnimGifRev1.zip (5.1 KB)