mrDarker
2025-07-16 1dbe46cd9d0f181d08d5a69f72d8548628a13b9d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#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);
};