pm_imagerotobox.h 910 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * File : pm_imagerotobox.h
  3. * COPYRIGHT (C) 2012-2017, Shanghai Real-Thread Technology Co., Ltd
  4. *
  5. * Change Logs:
  6. * Date Author Notes
  7. * 2017-11-05 realthread the first version
  8. */
  9. #pragma once
  10. #include <pm_widget.h>
  11. #include <pm_timer.h>
  12. #include <sigslot.h>
  13. namespace Persimmon
  14. {
  15. class ImageRotoBox : public Widget
  16. {
  17. public:
  18. ImageRotoBox(const char* img_name);
  19. virtual ~ImageRotoBox();
  20. void start(int once_ticks, int frame, bool once = true);
  21. void stop(void);
  22. Signal<void> finished;
  23. virtual void render(struct rtgui_dc* dc, const Point &dcPoint = Point(),
  24. const Rect &srcRect = Rect(),
  25. RenderFlag flags = DrawNormal);
  26. private:
  27. void timeout(void);
  28. protected:
  29. struct rtgui_dc *img_dc;
  30. Timer *timer;
  31. int coord_x, coord_y, frame;
  32. double roto_degree;
  33. bool roto_mode;
  34. };
  35. }