70 likes | 269 Views
MapX绘图操作功能的开发. 荆平 天津师范大学城环学院. Form_Load事件必须添加的代码. Dim newLayer As Layer Set newLayer = Map1.Layers.CreateLayer("Temporary Layer", , 1) newLayer.Editable = True Set Map1.Layers.InsertionLayer = newLayer UpdateToolbarButtons. Case 5
E N D
MapX绘图操作功能的开发 荆平 天津师范大学城环学院
Form_Load事件必须添加的代码 Dim newLayer As Layer Set newLayer = Map1.Layers.CreateLayer("Temporary Layer", , 1) newLayer.Editable = True Set Map1.Layers.InsertionLayer = newLayer UpdateToolbarButtons
Case 5 Map1.CurrentTool = miAddPolylineTool Case 6 Map1.CurrentTool = miAddRegionTool Case 7 Map1.CurrentTool = miTextTool Case 8 Map1.Rotation = Map1.Rotation + 10 End Select MapX绘图操作 Select Case Button.Index Case 1 Map1.CurrentTool = miArrowTool Case 2 Map1.CurrentTool = miSelectTool Case 3 Map1.CurrentTool = miAddPointTool Case 4 Map1.CurrentTool = miAddLineTool
删除文本标注 Map1.Annotations.Remove 1
图层的添加和删除 (1)图层的查看:Map1.Layers.LayersDlg (可添加、删除、调整顺序) (2)添加 Dim lyr As Layer Set lyr = Map1.Layers.CreateLayer(Text3.text, , 1) lyr.Editable = True Set Map1.Layers.InsertionLayer = lyr
图片的剪贴 Dim xx, yy As Single xx = Val(Text9.text) yy = Val(Text10.text) Map1.PaperUnit = miUnitCentimeter If xx = 0 Or yy = 0 Then Map1.ExportMap "clipboard", miFormatBMP, 8.5, 5.6 Else Map1.ExportMap "clipboard", FormatBMP, xx, yy End If
图片的粘贴 Picture1.Picture = Clipboard.GetData() Clipboard.Clear