Who's Online |
50 user(s) are online ( 33 user(s) are browsing Forums)
Members: 1
Guests: 49
root,
more...
|
|
Headlines |
-
arabic_console_devicepro2.lha - driver/input
Aug 9, 2022
-
kittymusicraft.library.lha - development/library
Aug 8, 2022
-
amiarcadia.lha - emulation/gamesystem
Aug 8, 2022
-
amosextension.library.lha - library/misc
Aug 8, 2022
-
luettjebookholler.lha - office/misc
Aug 6, 2022
-
mce.lha - game/utility
Aug 5, 2022
-
ign-addon-ods.lha - office/spreadsheet
Aug 5, 2022
-
avalanche_deu.lha - utility/archive
Aug 4, 2022
-
mednafen.lha - emulation/gamesystem
Aug 3, 2022
-
avalanche.lha - utility/archive
Aug 3, 2022
|
|
|
|
Displaying animated GIFs / PNGs
|
Posted on: 2020/12/1 12:45
#1
|
Just popping in 
Joined: 2009/2/21 14:27 Last Login
: 2021/10/27 9:34
Group:
Registered Users
|
Hi, I'd like to know how I can (dis)play animated GIFs / PNGs in the ReAction window of my application. I hope it's just a matter of telling the picture datatype where to load it from and where to draw it. But how? And will the animation keep running automatically and indefinitely, or do I regularly have to load and draw the next frame myself? Any help appreciated. :) Thanks, Tom
|
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/1 12:53
#2
|
Home away from home 
Joined: 2006/11/20 16:26 Last Login
: Today 6:27
From Norway
Group:
Registered Users
|
@tomsoniq
Look at datatype’s tutorials in the SDK, anim gif’s should work just as .anim files, if not I suggest converting your .gif files into .anim files.
Datatypes is OO style API, that provides class that can be interested into window or GUI.
|
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/2 12:37
#3
|
Just popping in 
Joined: 2009/2/21 14:27 Last Login
: 2021/10/27 9:34
Group:
Registered Users
|
Hmm, I can't find any dedicated datatypes example, only GUI/BackFill but that's not what I want. And I think it's a little more complex than just: LAYOUT_AddChild, Objects[OBJ_PICTURE] = NewDTObject( "picture.png", DTA_GroupID, GID_PICTURE, ICA_TARGET, ICTARGET_IDCMP, TAG_END), because that doesn't display anything. 
|
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/2 13:45
#4
|
Home away from home 
Joined: 2006/11/26 21:45 Last Login
: Today 11:51
From a dying planet
Group:
Registered Users
|
@tomsoniq Hey Tom Would this maybe help?
|
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/2 15:25
#5
|
Just popping in 
Joined: 2009/2/21 14:27 Last Login
: 2021/10/27 9:34
Group:
Registered Users
|
@Raziel Hi, that's pretty close but it attaches a datatype object to an empty space in a window at a fixed position where no gadget is. I need it as a child of a layout object.
I also tried adding it with LAYOUT_AddImage instead of LAYOUT_AddChild but that doesn't help either.
So my code for the layout section of the window currently is: LAYOUT_AddChild, LayoutObject, LAYOUT_VertAlignment, LALIGN_CENTER, LAYOUT_HorizAlignment, LALIGN_CENTER,
LAYOUT_AddChild, Objects[OBJ_BUTTON] = ButtonObject, GA_Text, "Button", ButtonEnd, CHILD_WeightedWidth, 0, CHILD_WeightedHeight, 0,
LAYOUT_AddImage, Objects[OBJ_PICTURE] = NewDTObject("picture.png", DTA_SourceType, DTST_FILE, DTA_GroupID, GID_PICTURE, PDTA_DestMode, PMODE_V43, PDTA_ScaleQuality, 1, TAG_END), CHILD_WeightedWidth, 0, CHILD_WeightedHeight, 0,
LayoutEnd, CHILD_WeightedHeight, 0,
But I only get the button, not the picture.
|
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/2 16:04
#6
|
Home away from home 
Joined: 2006/11/26 21:45 Last Login
: Today 11:51
From a dying planet
Group:
Registered Users
|
@tomsoniq
The only other thing i can find are the autodocs for datatypes...but i guess you already looked there?
|
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/2 16:17
#7
|
Home away from home 
Joined: 2006/11/20 16:26 Last Login
: Today 6:27
From Norway
Group:
Registered Users
|
@tomsoniq
Yes it gadtools, so I guess its not 100% compatible with Reaction, I guess need to move the gadget manually, when window resize etch, I know reaction has empty space gadget or something like that, can be used.
Custom reaction classes are possible.
|
(NutsAboutAmiga)
Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps.
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/3 20:01
#8
|
Amigans Defender 
Joined: 2006/11/17 22:40 Last Login
: Today 14:01
From England
Group:
Registered Users Moderators
|
Note that there are two GIF Anim data types. One is a picture subclass, the other is a animation subclass.
I don't think you can realistically attach either to a window although it probably depends on exactly what you are trying to achieve.
You either need to decode the frames through data types (but that depends on knowing whether you have picture or animation data, and handle it differently for each), or use your own decoding routine (or a 3rd party library - libnsgif is small and easy to use). In either case you will need to manually update the data in the window for each frame.
|
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/3 20:04
#9
|
Amigans Defender 
Joined: 2006/11/17 22:40 Last Login
: Today 14:01
From England
Group:
Registered Users Moderators
|
@tomsoniq
LAYOUT_AddImage is correct, but you need to give it a Reaction imageclass, not a datatypes object. I don't think there is an anim.image, but there is a bitmap.image which will load and display a picture subclass for you. If you want animation you'll need to update it with each frame manually.
|
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/4 10:45
#10
|
Home away from home 
Joined: 2006/11/26 21:45 Last Login
: Today 11:51
From a dying planet
Group:
Registered Users
|
@Chris
That sounds painful and cpu hungry
|
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/5 15:27
#11
|
Just can't stay away 
Joined: 2007/2/23 13:49 Last Login
: 5/20 0:40
From Finland, the land of Santa, sauna, sisu and salmiakki
Group:
Registered Users
|
@tomsoniq, others You can add a datatype object into a "Reaction" layout but CHILD_DataType,TRUE is needed.
LAYOUT_AddChild,IDataTypes->NewDTObject(...,TAG_END),
CHILD_DataType,TRUE,
CHILD_NoDispose,TRUE,
I don't think a layout/window can display animations on its own, like others have said. You have to display frames one by one on your own. Trying to display an anim gif as a datatype object that way (above) after installing gifanim datatype from os4depot simply crashes badly. In case the author of anim gif is interested it crashes with memory pointer DEADBEEF.
|
Rock lobster bit me, so excuse me. X1000 + AmigaOS 4.1 FE "Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/5 23:24
#12
|
Amigans Defender 
Joined: 2006/11/17 22:40 Last Login
: Today 14:01
From England
Group:
Registered Users Moderators
|
@Raziel
I do that in NetSurf but it's just blitted to the window, not to a gadget.
|
|
|
|
Re: Displaying animated GIFs / PNGs
|
Posted on: 2020/12/5 23:55
#13
|
Home away from home 
Joined: 2006/11/26 21:45 Last Login
: Today 11:51
From a dying planet
Group:
Registered Users
|
@Chris
Hmm, maybe that's sufficient? Thanks for the hint
@tomsonic
Would that help?
|
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg
|
|
Currently Active Users Viewing This Thread:
1
(
0 members
and 1 Anonymous Users
)
|
|
|