Click here to Skip to main content
15,897,149 members
Articles / Desktop Programming / MFC

Simple decoder/encoder for MNG animations

Rate me:
Please Sign up or sign in to vote.
4.71/5 (8 votes)
1 Oct 2001CPOL2 min read 103.7K   1.4K   45  
CxImageMNG: the module of CxImage used to play MNG animations.
// demoDoc.h : interface of the CDemoDoc class
//
/////////////////////////////////////////////////////////////////////////////
#define MAX_UNDO_LEVELS 8

#define	WM_USER_NEWIMAGE WM_USER+1
#define WM_USER_PROGRESS WM_USER+2

class CxImage;
class CxImageMNG;

class CDemoDoc : public CDocument
{
protected: // create from serialization only
	CDemoDoc();
	DECLARE_DYNCREATE(CDemoDoc)

// Attributes
public:

	CxImageMNG *image;				//main image

// Operations
public:
	inline CxImageMNG *GetImage() { return image; }
	inline BOOL GetStretchMode() { return stretchMode; }
	inline float GetZoomFactor() { return m_ZoomFactor; }

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDemoDoc)
	public:
	virtual BOOL OnNewDocument();
	virtual void Serialize(CArchive& ar);
	virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
	virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
	virtual BOOL DoSave(LPCTSTR pszPathName, BOOL bReplace =TRUE);
	//}}AFX_VIRTUAL

// Implementation
public:
	void Stopwatch(int start0stop1);
	void UpdateStatusBar();
	virtual ~CDemoDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	BOOL stretchMode;
	float m_ZoomFactor;
	LARGE_INTEGER m_swFreq, m_swStart, m_swStop; //stopwatch
	float m_etime; //elapsed time

	//{{AFX_MSG(CDemoDoc)
	afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI);
	afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
	afx_msg void OnStretchMode();
	afx_msg void OnUpdateStretchMode(CCmdUI* pCmdUI);
	afx_msg void OnWindowDuplicate();
	afx_msg void OnEditCopy();
	afx_msg void OnViewZoomin();
	afx_msg void OnViewZoomout();
	afx_msg void OnUpdateViewZoomin(CCmdUI* pCmdUI);
	afx_msg void OnUpdateViewZoomout(CCmdUI* pCmdUI);
	afx_msg void OnViewNormalviewing11();
	afx_msg void OnUpdateViewNormalviewing11(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
	afx_msg void OnCximagePauseanimation();
	afx_msg void OnCximageResumeanimation();
	afx_msg void OnCximageSinglestep();
	afx_msg void OnCximagemngSpeedSlow();
	afx_msg void OnCximagemngSpeedFast();
	afx_msg void OnCximagemngSpeedNormal();
	afx_msg void OnUpdateCximagePauseanimation(CCmdUI* pCmdUI);
	afx_msg void OnUpdateCximageSinglestep(CCmdUI* pCmdUI);
	afx_msg void OnUpdateCximageResumeanimation(CCmdUI* pCmdUI);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions