The native "DelayTime" should available for using/run in native Framerate.
@Fred
Is available in structure of your lib!
[done]GetDelayTimeImageFrame() [GIFImageDecoder]
[done]GetDelayTimeImageFrame() [GIFImageDecoder]
Last edited by ts-soft on Wed Feb 22, 2017 10:18 am, edited 1 time in total.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
- netmaestro
- PureBasic Bullfrog
- Posts: 8433
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: GetDelayTimeImageFrame() [GIFImageDecoder]
Excellent request! Reading an animated gif and splitting the frames is great, but of little use without the delays.
BERESHEIT
-
- Addict
- Posts: 1443
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: GetDelayTimeImageFrame() [GIFImageDecoder]
Yes, a very useful feature.
For example, here is a image of CodeArchiv.
PB animates with the wrong speed.
For example, here is a image of CodeArchiv.
PB animates with the wrong speed.
Code: Select all
InitNetwork()
UseGIFImageDecoder()
*Buffer = ReceiveHTTPMemory("http://www.purearea.net/pb/CodeArchiv/Graphics/Gfx/anim_surprize.gif")
If *Buffer And CatchImage(0, *Buffer, MemorySize(*Buffer))
OpenWindow(0, 100, 100, ImageWidth(0), ImageHeight(0), "")
CanvasGadget(0, 0, 0, ImageWidth(0), ImageHeight(0))
AddWindowTimer(0, 1, 150)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Timer
SetImageFrame(0, Frame)
Frame+1
If Frame >= ImageFrameCount(0) : Frame = 0 : EndIf
If StartDrawing(CanvasOutput(0))
DrawImage(ImageID(0), 0, 0)
StopDrawing()
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
Else
Debug "Impossible to load the file: " + Filename$
EndIf
Re: GetDelayTimeImageFrame() [GIFImageDecoder]
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.