Created
April 3, 2017 05:53
-
-
Save bstaint/60929a93d6cb52d0952f15ae7fd6b5d0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define CGIFANIMATE_H | |
#include <gdiplus.h> | |
#include "precompile.h" | |
using namespace Gdiplus; | |
class CGIFAnimate : public CStatic | |
{ | |
public: | |
CGIFAnimate(); | |
virtual ~CGIFAnimate(); | |
virtual void PreCreate(CREATESTRUCT& cs); | |
virtual LRESULT OnTimer(UINT, WPARAM, LPARAM); | |
virtual LRESULT OnMessageReflect(UINT uMsg, WPARAM wParam, LPARAM lParam); | |
void Load(LPCWSTR sFileName); | |
void Play(); | |
void Stop(); | |
inline UINT getDelay() | |
{ | |
assert(m_pItem); | |
UINT delay = ((UINT*)m_pItem[0].value)[m_CurrentFrame]; | |
return delay != 0 ? delay * 10 : 100; | |
} | |
protected: | |
virtual LRESULT WndProc(UINT, WPARAM, LPARAM); | |
LRESULT OnDrawItem(UINT, WPARAM, LPARAM); | |
private: | |
ULONG_PTR m_gdiplusToken; | |
Image * m_pImage; | |
GUID * m_pDimensionID; | |
PropertyItem * m_pItem; | |
UINT m_CurrentFrame; | |
UINT m_FrameCount; | |
}; | |
#endif // CGIFANIMATE_H |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment