I have an animated GIF that I want to use in my splash screen. So, I threw in a movieplayer and had it load and play the animated GIF. And it worked…mostly.
The issue I see is that the movieplayer plays each frame of the GIF without clearing the previous one. Therein is my question. Is there a way to force the movieplayer to blank its display area between frames? I would really rather not have to break the animated GIF into individual images and paint them, in order, to a canvas.
Full disclosure: Xojo 2019r3.1, Windows 10
I’d try an htmlviewer with the gif embedded on it as raw data so you dont need a URL etc
I’ve never tried that. In fact, I’m not even sure how to embed it as raw data.
the src tag in an html image should do it
cant say I’ve done it but I know its possible
I did a quick test with Canvas, ImageWell, HtmlViewer, and MoviePlayer. The HtmlViewer and MoviePlayer worked perfect. The Canvas and ImageWell did not. HtmlViewer displayed it the best.
I had this on a button to grab and display the image
Dim fType As New FileType
fType.Name = “image/gif”
fType.MacType = “GIF”
fType.Extensions = “gif”
Dim f As FolderItem = GetOpenFolderItem(fType)
If f Is Nil Then
ImageWell1.Image = Picture.Open(f)
Canvas1.Backdrop = Picture.Open(f)
MoviePlayer1.Movie = f.OpenAsMovie
I had this on the HTMLViewer
Sub DocumentComplete(URL as String)
And this on the MoviePlayer
MoviePlayer1.AutoPlay = True
MoviePlayer1.Looping = True
None of this is truly my code. I just extracted from the following:
Thanks for the suggestions. After some experimentation, I have decided that the most flexible method is to break the animated GIF into individual images and use a canvas to display the images in sequence. The speed of the animation can be controlled by a timer.