GdiImageDrawer.h 841 B

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