GifDecoder module (All OS, single frame & animated gifs)
- Andre
- PureBasic Team
- Posts: 2071
- Joined: Fri Apr 25, 2003 6:14 pm
- Location: Germany (Saxony, Deutscheinsiedel)
- Contact:
Re: GifDecoder module (All OS, single frame & animated gifs)
Nice, thank you for the possibility of an easy and proper GIF display in PB!
- Kwai chang caine
- Always Here
- Posts: 5357
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: GifDecoder module (All OS, single frame & animated gifs)
You are wonderfull !!
1/ My sheep leaps now like a gazelle, with the value 100
2/ The last GIF not crush the JPG thanks to the two parameters.
I have replace
Code: Select all
KillThread(*PtrAnimate\ThreadID)
Code: Select all
*PtrAnimate\Quit = #True
*PtrAnimate\Target = 0
Code: Select all
If IsGadget(Target)
SetGadgetState(Target, Image)
EndIf
And nooooowwwww...ladies and gentlemaaaaaaaan !!!!
All works fiiiine !!!
Before you are my champion of HieroGlyph, now you are also my champion of HieroGIF
Thanks a lot for the mountain of work you have do, for all the littles animated and sympathetics personages
I wish you a very good animated day !!!
The happiness is a road...
Not a destination
Not a destination
Re: GifDecoder module (All OS, single frame & animated gifs)
Glad to help out
You keep amazing me with the amount of animated gifs you have
You keep amazing me with the amount of animated gifs you have
I didn't get such error myself but an extra check does no harm so I added the gadget check to the module code in the first post.Kwai chang caine wrote:Just i allowed myself to massacre your work by addingCode: Select all
If IsGadget(Target) SetGadgetState(Target, Image) EndIf
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
- Kwai chang caine
- Always Here
- Posts: 5357
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: GifDecoder module (All OS, single frame & animated gifs)
It's my passionYou keep amazing me with the amount of animated gifs you have
Since the begining, at the moment of i see my first, i fall in love immediately ahead his beautiful body
The GIF are nices, funny and tireless....like KCC
And with the come of the 3D
this time i found them
SPLENDID !!!
Now...you are also in my collection...one GIF more
It's when i jump between JPG and GIF in the same imageGadget, perhaps an error of meI didn't get such error myself but an extra check does no harm so I added the gadget check to the module code in the first post.
Thanks to you...i have modify my little manager of GIF linker, who not works very well with WebGadget and ListIcon, to replace by WebGadget and ImageGadget
And all my babies can come to home, for be ready for the futur thread of forum
Before selected GIF
After selected GIF
Have a very good day GIFMASTER
The happiness is a road...
Not a destination
Not a destination
Re: GifDecoder module (All OS, single frame & animated gifs)
Resizable Gifs by Gadget size no matter the DPI.
- "Enable Dpi aware executable" in the compiler options.
- Add to line 369, "DPI.f = DesktopResolutionX()" in Module.
- Add to line 463, "ResizeImage(\image, GadgetWidth(*Animation\Target) * DPI, GadgetHeight(*Animation\Target) * DPI)" in Module.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
Re: GifDecoder module (All OS, single frame & animated gifs)
Short information.
The decoder has been integrated into PB for a long time
Update pb example
The decoder has been integrated into PB for a long time
Code: Select all
UseGIFImageDecoder()
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - ImagePlugin GIF Viewer example file
;
; (c) Fantaisie Software
;
; Modify example by mk-soft - Upscale gif images
;
; ------------------------------------------------------------
;
; Enable the GIF decoder
UseGIFImageDecoder()
; Loading a GIF file
If LoadImage(0, #PB_Compiler_Home+"Examples/Sources/Data/PureBasicLogo.gif")
dx = ImageWidth(0)
dy = ImageHeight(0)
OpenWindow(0, 100, 100, dx, dy, "GIF viewer")
CanvasGadget(0, 0, 0, dx, dy)
; Upscale
dx = DesktopScaledX(dx)
dy = DesktopScaledY(dy)
; Add a timer to animate the GIF, starts immediately to display the first frame witout delay
AddWindowTimer(0, 0, 1)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Timer
SetImageFrame(0, Frame)
; Each GIF frame can have its own delay, so change the timer accordingly
;
RemoveWindowTimer(0, 0)
AddWindowTimer(0, 0, GetImageFrameDelay(0))
If StartDrawing(CanvasOutput(0))
DrawImage(ImageID(0), 0, 0, dx, dy)
StopDrawing()
EndIf
; Go to next frame
Frame+1
If Frame >= ImageFrameCount(0) ; Cycle back to first frame, to play in loop
Frame = 0
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
Else
Debug "Impossible to load the file: " + Filename$
EndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: GifDecoder module (All OS, single frame & animated gifs)
Is it exactly this decoder or a different one?
PureBasic 6.04/XProfan X4a/Embarcadero RAD Studio 11/Perl 5.2/Python 3.10
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Windows 11/Ryzen 5800X/32GB RAM/Radeon 7770 OC/3TB SSD/11TB HDD
Synology DS1821+/36GB RAM/130TB
Synology DS920+/20GB RAM/54TB
Synology DS916+ii/8GB RAM/12TB
Re: GifDecoder module (All OS, single frame & animated gifs)
Wilberts code runs Gifs with High DPI much faster and smooth. PureBasic's method stutters here with High DPI. Debugger is off for both, of course.
EDIT: It's the CanvasGadget() that is slow. Rendering on WindowOutput() is much better.
EDIT: It's the CanvasGadget() that is slow. Rendering on WindowOutput() is much better.
www.posemotion.com
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.
PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef
Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT
Even the vine knows it surroundings but the man with eyes does not.