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

📄 dlgrastertoshp.cpp

📁 栅格矢量转换的dll,vc+ao写的
💻 CPP
字号:
// DlgRasterToShp.cpp : implementation file
//

#include "stdafx.h"
#include "AoConvert.h"
#include "DlgRasterToShp.h"
#include "common.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgRasterToShp dialog


CDlgRasterToShp::CDlgRasterToShp(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgRasterToShp::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgRasterToShp)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDlgRasterToShp::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgRasterToShp)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
	m_strInputRaster = "";
	m_strOutShp = "";
	DDX_Control(pDX,IDC_COMBO1,m_combBox);
	DDX_Text(pDX,IDC_EDIT1,m_strInputRaster);
    DDX_Text(pDX,IDC_EDIT2,m_strOutShp);
}


BEGIN_MESSAGE_MAP(CDlgRasterToShp, CDialog)
	//{{AFX_MSG_MAP(CDlgRasterToShp)
	ON_BN_CLICKED(IDC_VIEW_RASRTER, OnViewRasrter)
	ON_BN_CLICKED(IDC_VIEW_SHP, OnViewShp)
	ON_CBN_SELENDOK(IDC_COMBO1, OnSelendokCombo)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgRasterToShp message handlers

void CDlgRasterToShp::OnViewRasrter() 
{
	m_strInputRaster = gGetRasterPath();
    GetDlgItem(IDC_EDIT1)->SetWindowText(m_strInputRaster);
	
}

void CDlgRasterToShp::OnViewShp() 
{
	m_strOutShp = gGetShpPath();
    GetDlgItem(IDC_EDIT2)->SetWindowText(m_strOutShp);
	
}

BOOL CDlgRasterToShp::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	m_combBox.InsertString(0,"Point");
	m_combBox.InsertString(1,"PolyLine");
	m_combBox.InsertString(2,"PolyGon");
	m_combBox.SetCurSel(2);
	m_strFeatureClass = "PolyGon";
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgRasterToShp::OnSelendokCombo() 
{
  int i;
  i = m_combBox.GetCurSel();
  
  switch(i)
  {
     case 0 : m_strFeatureClass = "Point"; break;
	 case 1 : m_strFeatureClass = "PolyLine"; break;
	 case 2 : m_strFeatureClass = "PolyGon";  break;
	 
	 default: break;
  }	
 
}

⌨️ 快捷键说明

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