#pragma once // CImgDefect class CImgDefect : public CWnd { DECLARE_DYNAMIC(CImgDefect) public: CImgDefect(); virtual ~CImgDefect(); typedef struct tagMANUAL_MEASURE { BOOL bStart; BOOL bModifyStart; BOOL bModifyEnd; int nTextPos; CPoint ptMeasureStart; CPoint ptMeasureEnd; }MANUAL_MEASURE; protected: DECLARE_MESSAGE_MAP() private: CRect m_WndRect; CImage m_img; int m_nSide; int m_nCam; int m_nMode; BOOL m_bMeasure; int m_nTurn; int m_nTextPos; // 0: Text 免仿 救窃 1: left Top, 2: rigt top, 3: left bottom, 4: right bottom CString m_strTextInfo; double m_dPx,m_dPy; public: double m_dRatioX,m_dRatioY; CPoint m_ptOrg; MANUAL_MEASURE m_ManualMeausre; CPoint m_ptMouseCurrent; BOOL Create(RECT const & rect, CWnd * pParentWnd); void SetTextInfo(CString strInfo) {m_strTextInfo = strInfo;} void SetTextAlign(int nPos) {m_nTextPos = nPos;} void SetImgMode(int nMode) {m_nMode = nMode;} void SetMeasureAble(BOOL bMeasure) {m_bMeasure = bMeasure;} void SetImgTurn(int nMode); void SetDefectImage(int nSide,CString strPath,double dPixel_X,double dPixel_Y); int GetImgWidth(); int GetImgHeight(); void DrawManualMeasure(CDC &dc); void DrawTextInfo(CDC &dc); public: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnDestroy(); afx_msg void OnPaint(); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); };