10楼#
发布于:2003-09-27 09:41
但是矩形和圆都要画两次才能画上。为什么?
|
|
|
11楼#
发布于:2003-09-27 09:34
3楼的方法很好,帮我解决了问题。3Q
|
|
|
12楼#
发布于:2003-09-27 08:47
这个问题以前也讨论过,只是一直也没好的解决方法。我找了个把trakinglayer对象保存到shp中的例子,不过他里面实现的是多边形,你可以换成椭圆和其他看看。
Option Explicit Dim tl As MapObjects2.TrackingLayer Dim dc As New MapObjects2.DataConnection Dim mlyr As New MapObjects2.MapLayer Dim recs As MapObjects2.Recordset Private Sub Command1_Click() 'Move TrackingLayer polygons into the shapefile Dim i As Integer For i = 0 To tl.EventCount - 1 recs.AddNew Set recs.Fields("Shape").Value = tl.Event(i).Shape recs.Update Next recs.StopEditing 'Clear the tracking layer and redraw tl.ClearEvents Map1.Refresh End Sub Private Sub Form_Load() dc.Database = App.Path dc.Connect Set mlyr.GeoDataset = dc.FindGeoDataset("polys") Set recs = mlyr.Records mlyr.Symbol.Color = moLightGray Map1.Layers.Add mlyr 'Configure TrackingLayer and symbols Set tl = Map1.TrackingLayer tl.SymbolCount = 2 With tl.Symbol(0) .SymbolType = moFillSymbol .Style = moSolidFill .Color = moRed End With With tl.Symbol(1) .SymbolType = moLineSymbol .Style = moSolidLine .Color = moRed End With End Sub Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim poly As MapObjects2.Polygon Set poly = Map1.TrackPolygon tl.AddEvent poly, 0 End Sub [此贴子已经被作者于2003-9-27 9:01:23编辑过]
|
|
上一页
下一页