ImageViewer.h 759 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include "ScrollHelper.h"
  3. class CImageViewer : public CWnd
  4. {
  5. DECLARE_DYNAMIC(CImageViewer)
  6. public:
  7. CImageViewer();
  8. virtual ~CImageViewer();
  9. CBitmap *m_pBitmap;
  10. CScrollHelper m_scrollHelper;
  11. void UpdateBitmapSize();
  12. BOOL Create(CWnd* pParent);
  13. bool m_hoveringOverImage;
  14. protected:
  15. DECLARE_MESSAGE_MAP()
  16. afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  17. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  18. afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
  19. afx_msg void OnSize(UINT nType, int cx, int cy);
  20. afx_msg void OnPaint();
  21. public:
  22. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  23. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  24. };