Dark Bit Factory & Gravity
PROGRAMMING => Purebasic => Topic started by: ~Ar-S~ on January 28, 2017
-
Heyheyhey,
PB 5.60 beta 2 is out..
Lot's of interresting news !
- Added: GIF decoder support
- Added: SetImageFrame(), GetImageFrame(), ImageFrameCount(), AddImageFrame(), RemoveImageFrame()
- Added: UserAgent support to ReceiveHTTPMemory(), ReceiveHTTPFile() and GetHTTPHeaders()
- Added: #PB_Http_NoRedirect support for GetHTTPHeaders()
- Added: "Joe Doe <joe.doe@domain.com>" email format support for SendMail()
- Added: HTTPProxy() for Http related commands proxy support
- Added: Compression level support for CreatePack() and CompressMemory()
- Added: Large icons and text support to ToolBar library
- Added: GetUserDirectory() to get user specific directories
- Added: more flexibility to Base64Decoder to handle non padded input
- Added: Base64Encoder() and Base64Decoder() which takes string as input/output for easier use
- Added: color constants like #Black, #Blue etc. for all OS
- Added: Event() to get the current event (mainly useful from callback)
- Added: #PB_Canvas_Container support to have a container behaviour for canvas
- Added: #PB_EventType_Resize support for PanelGadget(), ContainerGadget(), CanvasGadget() and ScrollAreaGadget()
- Added: #PB_ListIcon_ColumnCount to GetGadgetAttribute() for ListIconGadget() to get the column count
- Added: #PB_All support to RemoveGadgetColumn() to remove all the columns
- Added: (IDE) templates are now saved when created to prevent lost if the IDE is not properly closed
- Added: (IDE) jump to a procedure now automatically unfold it if it was folded
- Added: (IDE) new specific popup menu for file tab to ease source file management
- Added: (IDE) find previous (reverse find)
- Changed: ToolBar, Menu and StatusBar are now excluded from inner window area for all OS
- Changed: MenuHeight(), StatusBarHeight() and ToolBarHeight() are now deprecated (all returns 0)
- Changed: renamed Base64Encoder() to Base64EncoderBuffer()
- Changed: renamed Base64Decoder() to Base64DecoderBuffer()
- Changed: removed 'define.b' syntax to change default type as it could create hard to find bugs.
Here is an exemple to use GIF picture with "Frame" included lib
EnJoY :||
; Ar-S // PB 5.60 beta1
; Gif viewer and animate with frame
Enumeration
#WIN
#GAD_IMAGE
#T
#IMAGEGIF
EndEnumeration
UseGIFImageDecoder()
Declare CatchImage_Net(Adr$)
Declare Count()
Declare ChangeFrame()
Declare exit()
Global Nbrframe
;LoadImage(#IMAGEGIF,"VOTREFICHIERGIF")
; OU BIEN
InitNetwork()
adr$ = "http://share.ldvmultimedia.com/boules.gif"
Image=CatchImage_Net(adr$) ;Modifie cela par le chemin de ton image
If Image <> 0
NbrFrame = ImageFrameCount(#IMAGEGIF)
Else
Debug "erreur de chargement de l'image"
End
EndIf
Procedure CatchImage_Net(Adr$)
InitNetwork()
Protected image
; By Ar-S
*Buffer = ReceiveHTTPMemory(Adr$)
If *Buffer
Image = CatchImage(#IMAGEGIF, *Buffer, MemorySize(*Buffer) )
FreeMemory(*Buffer)
ProcedureReturn Image
Else
ProcedureReturn #False
EndIf
EndProcedure
;;; End OR
Procedure Count()
ProcedureReturn NbrFrame
EndProcedure
Procedure ChangeFrame()
Static Frame
Frame + 1
If Frame = NbrFrame
Frame = 0
EndIf
Debug "Frame : " + Frame
; Affichage
SetImageFrame(#IMAGEGIF, Frame)
SetGadgetState(#GAD_IMAGE, ImageID(#IMAGEGIF))
EndProcedure
Procedure exit()
End
EndProcedure
If OpenWindow(#WIN, 0, 0, 150, 113, "Gif...", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ImageGadget(#GAD_IMAGE,0,0,150,113,ImageID(#IMAGEGIF))
AddWindowTimer(#WIN,3,80)
BindEvent(#PB_Event_CloseWindow, @exit())
BindEvent(#PB_Event_Timer, @ChangeFrame())
Repeat : WaitWindowEvent() : ForEver
EndIf
-
Nice, I'll take a peek at this later.
-
I wonder, who need gif Animation? I prefer png Sprite sheet.
But still working with 5.30 and 5.43lts. Too many Updates and new Versions in a really short time. And older SC need fixed again because newer PB versions can't execute commands from older PB releases. That's why i normally switch only once in a year to a newer Version. Looking forward
-
Beta 2 out.
Note that the 5.4x are LTS but 5.50 and more are none LTS so with new functions and with frequently updates.
who need gif Animation
It's always fun to use but the most important is the ImageFrame() lib. We can easily make an animation by adding frames to a sprite.
It's much easier than before.