GdiImageDrawer.h 746 B

1234567891011121314151617181920212223242526
  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 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. BOOL LoadRaw(unsigned char* bitmapData, int imageSize);
  12. UINT ImageWidth() { return m_pStdImage->m_pBitmap->GetWidth(); }
  13. UINT ImageHeight() { return m_pStdImage->m_pBitmap->GetHeight(); }
  14. protected:
  15. CGdiPlusBitmapResource* m_pStdImage;
  16. CDC* m_pCurBtn; // current pointer to one of the above
  17. CDC m_dcStd; // standard button
  18. //CDC m_dcBk;
  19. };