pm_image.h 837 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * File : pm_image.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 <rtgui/image.h>
  11. #include <rtgui/image_container.h>
  12. #include <pm_rect.h>
  13. namespace Persimmon
  14. {
  15. class Image
  16. {
  17. public:
  18. Image(const char* filename, rt_bool_t load = RT_TRUE);
  19. virtual ~Image();
  20. void getRect(Rect& rect);
  21. int getWidth();
  22. int getHeight();
  23. struct rtgui_image* getImage(void);
  24. void loadImage(const char *filename);
  25. virtual void render(struct rtgui_dc* dc, const Point& point);
  26. virtual void render(struct rtgui_dc* dc, const Rect& rect);
  27. protected:
  28. struct rtgui_image* image;
  29. #ifdef RTGUI_IMAGE_CONTAINER
  30. struct rtgui_image_item* item;
  31. #endif
  32. };
  33. }