html缓冲区分析代码,科学网—ArcGIS Engine二次开发学习(12)缓冲区分析 - 刘廷祥的博文...

这篇博客介绍了如何使用 ArcGIS Engine 进行缓冲区分析的二次开发,包括自定义菜单、创建窗体、设置控件以及执行缓冲区分析的详细步骤,通过窗体与地图交互,实现图层的选择、距离输入、单位选择和结果输出。
摘要由CSDN通过智能技术生成

本功能采用自定义菜单的方法,继承basecommand,具体步骤见教材。

0:新建项目GpBufferLayer,自定义生成一个菜单,命名为BufferSelectedLayerCmd.cs。在自定义菜单的代码中,修改onclick()事件的代码。public override void OnClick()

{

if (null == m_hookHelper)

return;

if (m_hookHelper.FocusMap.LayerCount > 0)

{

BufferDlg bufferDlg = new BufferDlg(m_hookHelper);

bufferDlg.Show();

}

}

其中,BufferDlg是需要新建的一个窗体BufferDlg.cs,也就是缓冲区分析的界面。

1、新建 form 窗体。

添加 2 个 groupbox 控件,3 个 textbox 控件,2 个 combobox 控件,3 个button 控件,3 个 label 控件。

8e5adfad025c1ad50cd52d2b087e4337.png

控件名称以及 text 属性需要修改,在下面的表里面。

9444e272cebb4d809a536d8e1488f9e8.png

1bb9af67149402b20fd720502d9c0dd8.png

Combobox 控件 cboUnits 的 Item 属性添加的内容为(可以自定义修改,此处为单位)

Unknown

Inches

Points

Feet

Yards

Miles

NauticalMiles

Millimeters

Centimeters

Decimeters

Meters

Kilometers

DecimalDegrees

955d9b1644241b7c27afd0c4ee33528e.png

2、窗体的代码如下:

(1)添加命名空间的引用using System;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using System.Runtime.InteropServices;

using ESRI.

  • 0
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
缓冲区代码 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "stream.h" int quit; #define DELAY_MAX 5000 //最大延时5000毫秒 #define IN_NUM (2) #define MAIN_STREAM (0) #define SLAVE_STREAM (1) void Init_Interface(int Msg_id) { int qid; if(ApproDrvInit(Msg_id)) exit(1); if (func_get_mem(&qid)) { ApproDrvExit(); exit(1); } } void Clean_Interface(void) { ApproInterfaceExit(); } static int alarm_rec_enable; static unsigned int deltime; static unsigned int GetTimeStamp(void) { struct timeval timeval; gettimeofday(&timeval, NULL); return (timeval.tv_sec * 1000) + (timeval.tv_usec + 500) / 1000;; } void *get_frame(void *arg) { FILE *filefd=NULL; char filename[80]; int ch=0; stream_rpos_t rpos; frame_head_t frame_head; int first_frame_type=0; int first_frame=0; char *frame_pos; char *data; unsigned int cur_time; printf("get ch %d stream\n", ch); memset(&rpos, 0, sizeof(rpos)); st_stream_getStartPos(ch, MAIN_STREAM, &rpos); st_stream_getOneFrame(ch, MAIN_STREAM, 10, &rpos); while(!quit) { if(alarm_rec_enable) { if(st_stream_getOneFrame(ch, MAIN_STREAM, 200, &rpos) <= 0) { usleep(10*1000); continue; } frame_pos = &rpos.p_buf_data[rpos.data_start_pos]; memcpy(&frame_head,&rpos.p_buf_data[rpos.data_start_pos],sizeof(frame_head)); data=frame_pos+sizeof(frame_head_t
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值