物探论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 461|回复: 0

MAPX中关于输出问题

[复制链接]
发表于 2013-3-15 18:19:58 | 显示全部楼层 |阅读模式
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 * 100
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 ‘将选中部分以不同于其他未选中地

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|物探论坛 ( 鄂ICP备12002012号 微信号:iwutan )

GMT+8, 2024-5-12 07:13 , Processed in 0.471293 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

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