『公告』 预祝您龙年大吉,万事如意, 过节期间, 大家如需数据服务,请拨打400 或直接添加客服微信,再祝大家龙年,心想事成。
关注我们 新浪 腾讯
首页 -> 3S基础知识 -> MapInfo-> 正文

MapX应用教程(5)—输出

MapX应用教程(5)—输出

       属性的输出   输出到EXCEL

       五、输出

       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   ‘将选中部分以不同于其他未选中地图部分

形式输出

      京ICP备08100627号-22 京公网安备 11010802030428号