GdiImageDrawer.h 1005 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include "CGdiPlusBitmap.h"
  3. #include "DPI.h"
  4. class CGdiImageDrawer
  5. {
  6. public:
  7. CGdiImageDrawer();
  8. ~CGdiImageDrawer();
  9. BOOL LoadStdImage(UINT id, LPCTSTR pType);
  10. BOOL LoadStdImageDPI(int dpi, UINT id96, UINT id120, UINT id144, UINT id168, UINT id192, LPCTSTR pType, UINT id225 = 0, UINT id250 = 0, UINT id275 = 0, UINT id300 = 0, UINT id325 = 0, UINT id350 = 0);
  11. void Draw(CDC* pScreenDC, CDPI &dpi, CWnd *pWnd, int posX, int posY, bool mouseHover, bool mouseDown, int forceWidth = INT_MAX, int forceHeight = INT_MAX);
  12. void Draw(CDC* pScreenDC, CDPI &dpi, CWnd *pWnd, CRect rc, bool mouseHover, bool mouseDown);
  13. BOOL LoadRaw(unsigned char* bitmapData, int imageSize);
  14. UINT ImageWidth() { return m_pStdImage->m_pBitmap->GetWidth(); }
  15. UINT ImageHeight() { return m_pStdImage->m_pBitmap->GetHeight(); }
  16. void Reset();
  17. protected:
  18. CGdiPlusBitmapResource* m_pStdImage;
  19. //CDC* m_pCurBtn; // current pointer to one of the above
  20. //CDC m_dcStd; // standard button
  21. //CDC m_dcBk;
  22. };