爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 3785|回复: 1

[资源分享] surfer二次开发代码

[复制链接]

新浪微博达人勋

发表于 2016-5-14 20:56:02 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
using System;
using System.Threading;
using System.Drawing;

// Before using this code you need to add a reference to the Surfer.exe program,
// which will automatically cause a type library to be generated.
// 1. In Visual Studio .NET, open the Solution Explorer
// 2. Right-click on References and select "Add Reference"
// 3. Click "Browse", find Surfer.exe and click "Open"
// 4. Click OK
// You can all add "using Surfer;" to the top of this file to to avoid having to
// reference the Server namespace on declarations.
//
//

namespace TT
{
/// <summary>
/// Demonstrates how to control surfer from a C# class
/// </summary>
public class SurferControl {
public Surfer.IColorMap ColorMap;

public SurferControl() {
//
// TODO: Add constructor logic here
//
// Make an instance of the application
Surfer.ApplicationClass AppSurfer = new Surfer.ApplicationClass();

// Make the application visible
AppSurfer.Visible = true;

// Get the Documents collection
Surfer.IDocuments Docs = AppSurfer.Documents;

// Add a new document to the Documents collection
Surfer.IPlotDocument Doc = (Surfer.IPlotDocument) Docs.Add(Surfer.SrfDocTypes.srfDocPlot);

// Get the Shapes collection from the document
Surfer.IShapes Shapes = Doc.Shapes;

// Create a shaded relief map from the helens2.grd file
Surfer.IMapFrame MapFrame = Shapes.AddReliefMap(AppSurfer.Path + @"\samples\helens2.grd");

// Get the shaded relief overlay from the map frame
Surfer.IReliefMap ReliefMap = (Surfer.IReliefMap) MapFrame.Overlays.Item(1);

// Get the ColorMap used by the relief map
ColorMap = ReliefMap.ColorMap;

// Animate the colors of the shaded relief map from the default black to red.
Thread AnimateThread = new Thread(new ThreadStart(AnimateColorMap));
AnimateThread.Start();

}


密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-5-14 21:10:20 | 显示全部楼层
抢个沙发哈哈
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表