|
Post by wbtcpip on Jun 7, 2024 0:49:23 GMT 1
Do you know a simple way to load and show a looped gif animation into an image control?
|
|
|
Post by larrybtoys on Jun 9, 2024 16:13:36 GMT 1
This is Hangry Man, My version of a PacMan style game. Written entirely in GFA Basic 32 (GB32). Make sure you select HD video. youtu.be/6PFeZog1fGc
|
|
webu
Full Member
Posts: 158
|
Post by webu on Jun 10, 2024 18:17:04 GMT 1
This is getting there. You'll need ffmpeg to parse the frames in the animated GIF. This code uses ffmpeg to extract the frames of the GIF to a local frames directory as JPG files, then plays them back using the render method of the picture object.
The slider will let you scrub the frames forward and backwards.
If I could get an AVI or MP4 to play using MCI then perhaps it would suffice to convert a GIF to video format and use MCI. For the moment I am getting stonewalled by MCI when it come to playing any video files. I've tried refreshing/adding codecs. Still no joy.
In the code i do not understand this: ' This command will extract each frame from input.gif and save them as ' JPG files with names like frame0001.bmp, frame0002.bmp, etc. Give this "bmp" at irfanview and he would open it as jpg, because he knows, what is do. But he will ask you about the wrong extension? What is the trick? Why?
|
|
|
Post by wbtcpip on Jun 13, 2024 15:31:22 GMT 1
i solved using libmpv mpvmeteohandle = mpv_create() If mpvmeteohandle MPVSetPropertyString(mpvmeteohandle, "keep-open", "always") MPVSetPropertyString(mpvmeteohandle, "keep-open-pause", "no") MPVSetPropertyString(mpvmeteohandle, "cache", "no") MPVSetPropertyString(mpvmeteohandle, "audio-display", "no") MPVSetPropertyString(mpvmeteohandle, "aid", "no") If mpv_initialize(mpvmeteohandle) = 0 MPVSetPropertyString(mpvmeteohandle, "alpha", "blend") MPVSetPropertyString(mpvmeteohandle, "loop", "inf") MPVSetPropertyString(mpvmeteohandle, "image-display-duration", "inf") MPVSetPropertyInt(mpvmeteohandle, "wid", imgvideoweather.hWnd) <----- imgvideoweather is a gb32 image ocx MPVCommand(mpvmeteohandle, "loadfile", EncodeUTF8("mygif.gif"))
EndIf EndIf
with the same code you can play any multimedia video file or display any pciture
Attachments:LIBMPV.inc.g32 (12.4 KB)
|
|