wcout / fltk-gif-animation Goto Github PK
View Code? Open in Web Editor NEWFLTK Animated GIF display
FLTK Animated GIF display
Still finding this code to be extremely useful.
I've used the patch which changes fl_images_core.cxx
, in fl_check_images
, so that GIF files are loaded as Fl_Anim_GIF_Image
instances.
But this leads to the following convolution when it comes time to draw, in order to handle non-animated GIFs:
if (animgif_->is_animated())
{
animgif_->draw(xoff, yoff, xsize, ysize);
}
else
{
animgif_->Fl_Pixmap::draw(xoff, yoff, xsize, ysize);
}
It "works" but requires "knowing" that Fl_Anim_GIF_Image
is derived from Fl_Pixmap
!
I'd prefer that animgif_->draw()
would work for both animated and still GIFs. I'm not smart enough yet to quite understand the implications of this comment in the Fl_Anim_GIF_Image
code:
// Note: should the base class be called here?
// If it is, then the copy() method must also
// copy the base image!
// Inherited::draw(x_, y_, w_, h_, cx_, cy_);
Advice, fixes appreciated.
.. because it erroneously always copies with size of whole canvas size instead only the with size/offset of the previous frame.
Just getting started but so far this project is looking fantastic!!
A blocker for Windows users: in Fl_Anim_GIF_Image.cxx
, in the function readin
, the following line (at or about line 548):
FILE *gif = fopen(name_, "r");
needs to be changed to:
FILE *gif = fopen(name_, "rb");
Without the binary flag, Windows will stop reading at the first zero byte.
As alluded to in issue #2, the attached animated GIF image cannot be loaded by Fl_Anim_GIF_Image.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.