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
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
@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,
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
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.
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.
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.
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
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
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