CImageView.h 1007 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #define MSG_RETANGE WM_USER+100
  3. // CImageView
  4. class CImageView : public CWnd
  5. {
  6. DECLARE_DYNAMIC(CImageView)
  7. public:
  8. CImageView();
  9. virtual ~CImageView();
  10. protected:
  11. DECLARE_MESSAGE_MAP()
  12. private:
  13. int CaculateROIAvg();
  14. int CreatRect(CPoint ps, CPoint pe);
  15. int CreateImage(unsigned short* data, int width, int height);
  16. int CreatBitImage(unsigned char* pdata, int width, int height);
  17. private:
  18. unsigned short* m_pData16;
  19. unsigned char* m_pData8;
  20. int m_width;
  21. int m_height;
  22. int m_bits;
  23. CImage m_Image;
  24. CPoint m_ptStart;
  25. CPoint m_ptEnd;
  26. bool m_bDrawRect;
  27. CRect m_rtDraw;
  28. float m_wfRation;
  29. float m_hfRation;
  30. CRect m_rtOrgDraw;
  31. int m_nROIAverage;
  32. public:
  33. bool SetImageData(unsigned short* pdata, int width, int height, int bits);
  34. afx_msg void OnPaint();
  35. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  36. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  37. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  38. };