UIGifAnimEx.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef GifAnimUIEX_h__
  2. #define GifAnimUIEX_h__
  3. #pragma once
  4. /* write by wangji 2016.03.16
  5. ** 解决多个gif控件在gdi+环境下占用CPU过高的问题,本类采用ximage替代
  6. ** 注意:使用的时候在预编译头文件中包含UIlib.h前先定义宏USE_XIMAGE_EFFECT
  7. ** #define USE_XIMAGE_EFFECT
  8. ** #include "UIlib.h"
  9. */
  10. #ifdef USE_XIMAGE_EFFECT
  11. namespace DuiLib
  12. {
  13. class CLabelUI;
  14. class UILIB_API CGifAnimExUI : public CLabelUI
  15. {
  16. DECLARE_DUICONTROL(CGifAnimExUI)
  17. public:
  18. CGifAnimExUI(void);
  19. ~CGifAnimExUI(void);
  20. public:
  21. virtual LPCTSTR GetClass() const;
  22. virtual LPVOID GetInterface(LPCTSTR pstrName);
  23. virtual void Init();
  24. virtual void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue);
  25. virtual void SetVisible(bool bVisible = true);
  26. virtual void SetInternVisible(bool bVisible = true);
  27. virtual bool DoPaint(HDC hDC, const RECT& rcPaint, CControlUI* pStopControl);
  28. virtual void DoEvent(TEventUI& event);
  29. public:
  30. void StartAnim();
  31. void StopAnim();
  32. protected:
  33. struct Imp;
  34. Imp* m_pImp;
  35. };
  36. }
  37. #endif //USE_XIMAGE_EFFECT
  38. #endif // GifAnimUIEx_h__