#pragma once #define MSG_RETANGE WM_USER+100 // CImageView class CImageView : public CWnd { DECLARE_DYNAMIC(CImageView) public: CImageView(); virtual ~CImageView(); protected: DECLARE_MESSAGE_MAP() private: int CaculateROIAvg(); int CreatRect(CPoint ps, CPoint pe); int CreateImage(unsigned short* data, int width, int height); int CreatBitImage(unsigned char* pdata, int width, int height); private: unsigned short* m_pData16; unsigned char* m_pData8; int m_width; int m_height; int m_bits; CImage m_Image; CPoint m_ptStart; CPoint m_ptEnd; bool m_bDrawRect; CRect m_rtDraw; float m_wfRation; float m_hfRation; CRect m_rtOrgDraw; int m_nROIAverage; public: bool SetImageData(unsigned short* pdata, int width, int height, int bits); afx_msg void OnPaint(); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); };