📄 hwpreview.h
字号:
// hwpreView.h : interface of the CHwpreView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_HWPREVIEW_H__D89764B0_2284_4D4C_B6F8_675587AA7B0D__INCLUDED_)
#define AFX_HWPREVIEW_H__D89764B0_2284_4D4C_B6F8_675587AA7B0D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DlgIntensity.h"
#include "LineInfo.h"
const double SplitScale = 1.3;
class CHwpreView : public CScrollView
{
protected: // create from serialization only
CHwpreView();
DECLARE_DYNCREATE(CHwpreView)
// Attributes
public:
CHwpreDoc* GetDocument();
CDlgIntensity * m_pdlgParaIntensity;
int m_iIsDraging; // 当前鼠标拖动状态,0表示未拖动,1表示正在拖动
CRect m_MouseRect; //检测鼠标的矩形
CRect m_DragRect; //正在拖动的矩形
CPtrList m_ListRect; //矩形列表 这是与图片相同单位的,没有缩放。
CPoint m_ptCurRect; //当前选中的矩形的左上点
LineInfo * LinesInfoHead,* LinesInfoRear;
int LinesInfoLength;
int maxLineHeight;
int nudDensity ;
int nudPunctuationWidth;
int nudSpace ;
int nudCharWidth ;
// Operations
public:
CRect DibToDisp(CRect & cr);
CRect DispToDib(CRect & cr);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHwpreView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual void OnInitialUpdate(); // called first time after construct
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
void DrawSplitResult();
void RemoveExtraSplits();
void RemoveSpaces();
BOOL CanMerge(WordFragmentInfo * current, WordFragmentInfo * leftOne);
void MergeFromRight();
void RemovePunctuations();
WordFragmentInfo * SplitWordFragment(WordFragmentInfo * fragment, int bound);
void SplitWords();
void GetStaticsOfEachLine();
void CPtrListToLineInfo();
BOOL m_bshowNumber;
virtual ~CHwpreView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
enum{
ID_DISP_ORIG = 0, //原始比例显示
ID_DISP_STRETCH1 = 1, //按窗口大小拉伸显示
ID_DISP_STRETCH2 = 2 //按比例拉伸
} m_bStretchDisp;
CRect m_rectView;
// Generated message map functions
protected:
//{{AFX_MSG(CHwpreView)
afx_msg LRESULT OnDoRealize(WPARAM wParam, LPARAM lParam); // user message
afx_msg void OnViewOrig();
afx_msg void OnUpdateViewOrig(CCmdUI* pCmdUI);
afx_msg void OnViewStretch1();
afx_msg void OnUpdateViewStretch1(CCmdUI* pCmdUI);
afx_msg void OnViewStretch2();
afx_msg void OnUpdateViewStretch2(CCmdUI* pCmdUI);
afx_msg void OnTranThre();
afx_msg void OnPointEqua();
afx_msg void OnEdgeHough();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnEgHproject();
afx_msg void OnEgVproject();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnEgHline();
afx_msg void OnEdHega2();
afx_msg void OnEgVword();
afx_msg void OnViewShownumber();
afx_msg void OnUpdateViewShownumber(CCmdUI* pCmdUI);
afx_msg void OnMorphThining();
afx_msg void OnMorphDilation();
afx_msg void OnAutoHough();
afx_msg void OnGaborFFT();
afx_msg void OnGaborFFT32();
afx_msg void OnEditSelect();
afx_msg void OnOriHanzi();
afx_msg void OnOriHanzi32();
afx_msg void OnEditCopy1to2();
afx_msg void OnEditCopy2to1();
afx_msg void OnSmooth();
afx_msg void OnSmoothV();
afx_msg void OnEdHega3();
afx_msg void OnEgVprojectAll();
afx_msg void OnEgVword2();
afx_msg void OnEditClearallrect();
afx_msg void OnSaveResult();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
BOOL NeedMoreSplit();
};
#ifndef _DEBUG // debug version in hwpreView.cpp
inline CHwpreDoc* CHwpreView::GetDocument()
{ return (CHwpreDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_HWPREVIEW_H__D89764B0_2284_4D4C_B6F8_675587AA7B0D__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -