⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matchdoc.cpp

📁 基于摄影测量学中FORNSTER算子
💻 CPP
字号:
// MatchDoc.cpp : implementation of the CMatchDoc class
//

#include "stdafx.h"
#include "Match.h"

#include "MatchDoc.h"
#include "PathSec.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMatchDoc

IMPLEMENT_DYNCREATE(CMatchDoc, CDocument)

BEGIN_MESSAGE_MAP(CMatchDoc, CDocument)
	//{{AFX_MSG_MAP(CMatchDoc)
	ON_COMMAND(IDM_XIGUANG, OnXiguang)
	ON_COMMAND(IDM_SELECT, OnSelect)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMatchDoc construction/destruction

CMatchDoc::CMatchDoc()
{
	// TODO: add one-time construction code here
	m_hDIB1  =   NULL;
	m_hDIB2  =   NULL;
    m_bSec   =   false;
}

CMatchDoc::~CMatchDoc()
{
	GlobalUnlock(m_hDIB1);
	GlobalUnlock(m_hDIB2);
}

BOOL CMatchDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CMatchDoc serialization

void CMatchDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CMatchDoc diagnostics

#ifdef _DEBUG
void CMatchDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CMatchDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMatchDoc commands

void CMatchDoc::OnXiguang() 
{
	// TODO: Add your command handler code here
	CPathSec  dlg;
	if (dlg.DoModal() != IDOK)
	{
		return ;
	}
	CString   str1  =  dlg.m_Path1;
	m_hDIB1  =   Open(str1);
	m_hDIB2  =   Open(dlg.m_Path2);
    UpdateAllViews(NULL);
	LPSTR  lpbi1  =  (LPSTR)GlobalLock(m_hDIB1);
	LPSTR  lpbi2  =  (LPSTR)GlobalLock(m_hDIB2);
	m_nWidth1     =  DIBWidth(lpbi1);
	m_nHeight1    =  DIBHeight(lpbi1);
	m_nWidth2     =  DIBWidth(lpbi2);
	m_nHeight2    =  DIBHeight(lpbi2);
	m_nEffectWidth1= ( m_nWidth1 * 8 + 31) / 32 * 4;
	m_nEffectWidth2= ( m_nWidth2 * 8 + 31) / 32 * 4;
	m_pBits1      =  (unsigned  char*)FindDIBBits(lpbi1);
	m_pBits2      =  (unsigned  char*)FindDIBBits(lpbi2);

	
}

void CMatchDoc::OnSelect() 
{
	// TODO: Add your command handler code here
	m_bSec  =  true;

	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -