- 积分
- 3
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-6-7
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
我需要在这张图的顶部加上一些文字信息。
string strAppPath = Server.MapPath("data");
// 调用Surfer画等值线
Surfer.Application app = new Surfer.Application();
app.WindowState = SrfWindowState.srfWindowStateNormal;
app.ShowStatusBar = false;
app.Visible = false;
app.Caption = @"Suirfer绘制等值线图";
Surfer.IDocuments Docs = app.Documents;
// Type.Missing为缺省参数
app.GridData(strAppPath + "\\"+drpZB.SelectedValue+".dat", 1, 2, 3, Type.Missing, //5
Type.Missing, Type.Missing, Type.Missing,502, 558, //10
115.84834f, 120.442548f, 23.567314f, 28.316788f,2, //15
false, Type.Missing, Type.Missing, Type.Missing, Type.Missing, //20
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, //25
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, //30
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, //35
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, //40
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, //45
Type.Missing, Type.Missing, Type.Missing, Type.Missing, strAppPath + "\\"+drpZB.SelectedValue+".grd", //50
SrfGridFormat.srfGridFmtAscii, Type.Missing, Type.Missing, Type.Missing, Type.Missing, //55
Type.Missing, Type.Missing
);
app.GridBlank(strAppPath + "\\" + drpZB.SelectedValue + ".grd", strAppPath + @"\fj.bln", strAppPath + @"\out" + drpZB.SelectedValue + ".grd", SrfGridFormat.srfGridFmtAscii);
Surfer.IPlotDocument PlotDoc = (Surfer.IPlotDocument)Docs.Add(SrfDocTypes.srfDocPlot);
Surfer.IMapFrame MapF = PlotDoc.Shapes.AddContourMap(strAppPath + @"\out" + drpZB.SelectedValue + ".grd");
//PlotDoc.Shapes.AddBaseMap(strAppPath + @"\region.bln", "");
//PlotDoc.Shapes.AddBaseMap(strAppPath + @"\县界.bln", "");
IPostMap PostMap = (IPostMap)PlotDoc.Shapes.AddPostMap(strAppPath + "\\"+drpZB.SelectedValue+".dat", 1, 2, 3, 0, 0).Overlays.Item(1);
IPostMap PostMap1 = (IPostMap)PlotDoc.Shapes.AddPostMap(strAppPath + "\\" + drpZB.SelectedValue + ".dat", 1, 2, 4, 0, 0).Overlays.Item(1);
// 数据和站点显示
PostMap.LabelPos = SrfPostPosType.srfPostPosBelow;
PostMap.LabelFont.Face = @"宋体";
PostMap.LabelFont.Size = 9;
PostMap.Symbol.Index = 11;
PostMap.Symbol.Color = srfColor.srfColorBlue;
PostMap.Symbol.Size = 0.04;
PostMap1.LabelPos = SrfPostPosType.srfPostPosAbove;
PostMap1.LabelFont.Face = @"宋体";
PostMap1.LabelFont.Size = 9;
PostMap1.Symbol.Index = 11;
PostMap1.Symbol.Color = srfColor.srfColorBlue;
PostMap1.Symbol.Size = 0.04;
//IPostMap PostMapCap = (IPostMap)PlotDoc.Shapes.AddPostMap(
//等值线填充
Surfer.IContourMap ContourMap = (Surfer.IContourMap)MapF.Overlays.Item(1);
ContourMap.FillContours = true;
ContourMap.ShowColorScale = true;
ContourMap.SmoothContours = SrfConSmoothType.srfConSmoothHigh;
ContourMap.Levels.LoadFile(strAppPath + @"\RainBow1.lvl");
//覆盖所有地图
PlotDoc.Shapes.SelectAll();
Surfer.IMapFrame MapFrame = PlotDoc.Selection.OverlayMaps();
MapFrame.Axes.Item(1).Visible = false;
MapFrame.Axes.Item(2).Visible = false;
MapFrame.Axes.Item(3).Visible = false;
MapFrame.Axes.Item(4).Visible = false;
PlotDoc.SaveAs(strAppPath + "\\"+drpZB.SelectedValue+".srf", "", SrfSaveFormat.srfSaveFormatDat);
string strWidthHeight = string.Format("width={0:f0},height={1:f0}", 600.0 * 1.2, 465.0 * 1.2);
PlotDoc.Export(strAppPath +"\\"+drpZB.SelectedValue+"Contour.gif", true, strWidthHeight);
image1.Src = "data\\"+drpZB.SelectedValue+"Contour.gif";
app.Quit();
|
|