3S基础知识:MapX应用教程—输出

  输出

  1、属性的输出 输出到EXCEL表:

  For I=1 to Flds.Count

  Lyr.KeyFields=Flds.Item(i).Name

  Excel(1,I).Cell=Ftr.KeyValue

  Next

  2、复制、粘贴

  Global CopyFtrs AS MapXlib.Features

  Set lyr=mainmap.Layers.item(LayerName)

  Set Ftrs=Lyr.Selection.Clone ‘复制选中集合

  ‘复制

  For I=1 to Ftrs.Count

  CopyFtrs.add Ftrs.Item(I)

  Next

  ‘粘贴(图形)

  Set lyr_1=mainmap.Layers.item(LayerName_1)

  Mainmap.AutoRedraw=False

  Lyr_1.Editabled=True

  For J=1 to CopyFtrs.Count

  Lyr_1.AddFeature CopyFtrs.Item(J)

  Next

  Lyr_1.Refresh

  Mainmap.AutoRedraw=True

  Lyr_1.Editabled=False

  3、地图的打印

  Dim iScaleMode As Integer

  iScaleMode = MainMap.Container.ScaleMode

  MainMap.Container.ScaleMode = 6

  On Error GoTo PrinterError

  Printer.Print " "

  Printer.CurrentX = 0

  Printer.CurrentY = 0

  MainMap.PrintMap Printer.hDC, 0, 0, MainMap.Width * 100, MainMap.Height * 10

  0

  Printer.NewPage

  Printer.EndDoc

  MainMap.Container.ScaleMode = iScaleMode

  Exit Sub

  PrinterError:

  If Err.Number = 482 Then

  On Error Resume Next

  CommonDialog1.Flags = &H40

  CommonDialog1.ShowPrinter

  Else

  MsgBox " 打印机存在错误,请更正后重试。错误号:" + (Str(Err.Number)),

  , "失败"

  End If

  4、另存为图片文件

  MainMap.ExportMap(App.Path+”Images”, miFormatJPEG) ‘输出当前地图窗口

  参数设置:MainMap.ExportSelection=True ‘将选中部分以不同于其他未选中地图部分

  形式输出

猜你喜欢

转载自blog.csdn.net/u010687924/article/details/78498367
今日推荐