CxImageMNG - A class to read MNG, JNG and PNG images

WEBINAR:On-demand webcast

How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >

Environment: VC6

Introduction

CxImageMNG is the module of CxImage
used to play MNG animations. It uses the CxImage members, but to play the animation
are necessary additional variables and functions. I decided to keep separated
the MNG stuff from the "static" formats, to limit the growth of the
base class due to the new features.

As with the other modules, CxImageMNG is mainly an interface for the LibMNG
functions, it takes care of the I/O operations and of the specific requirements
of the library. CxImageMNG can read also PNG and JNG images.

This class requires some extra libraries to work: LibMNG, you can find
here the latest version; JPEG and ZLIB libraries, used by LibMNG to endode/decode files. All these libraries are included in the source code.

Structures & callbacks

"Libmng makes extensive use of callback functions. This is meant to keep
the library as platform-independant and flexible as possible.", in CxImageMNG
these are declared as:

Some of these are empty (mymngopenstream), or obvious (mymngreadstream), the most useful for the final applications are mymngprocessheader, where we get the first informations about the image, and mymngsettimer, where get the essential value for the timer.

Another important parameter is pUserdata, where the application
can store its parameters, in CxImageMNG this is a pointer to the mnginfo variable.

The WM_USER_NEWFRAME message tells to the main application that
a new frame is ready to be shown. The Resume() function is used
to obtain the next frame.
To stop the animation simply set image->mnginfo.animation_enabled =
0.The thread is automatically closed in the CxImageMNG destructor.

Finally you can display the image: image->Draw(pDC->GetSafeHdc());

Credits.

LIBMNG Copyright (c) 2000,2001 Gerard Juyn (gerard@libmng.com).

Original mng.cpp code created by Nikolaus Brennig, November 14th, 2000.
(virtualnik@nol.at).

Special thanks to Frank Haug (f.haug@jdm.de) for suggestions and code.

More specific credits and disclaimers are in every header file of each library.