计算机二级VB辅导:VB实现ZRenderer渲染
来源:优易学  2011-12-10 19:52:52   【优易学:中国教育考试门户网】   资料下载   IT书店

 

  Private Sub make_LPlacer()
  Dim lp As New MapObjects2.LabelPlacer
  Dim fnt As New StdFont
  fnt.Name = "Arial"
  fnt.Bold = True
  With lp
  Set .DefaultSymbol.Font = fnt
  .UseDefault = True
  .DefaultSymbol.Height = text_height * Map1.Extent.Height / scale_width
  .Field = "name"
  .DrawBackground = True
  End With
  Map1.Layers(0).Renderer = lp
  End Sub
  Private Sub sel3d_Click()
  floor.Enabled = True
  ceiling.Enabled = True
  MsgBox "将选择三维立方体内的山峰,立方体的底部为" & floor & ",顶部为" & ceiling
  Map1.MousePointer = moCross
  Toolbar1.Buttons("rect").Value = 1
  End Sub
  Private Sub Toolbar1_ButtonClick(ByVal Button As MSComCtlLib.Button)
  On Error Resume Next
  Select Case Button.Key
  Case "zoomin"
  '应做:添加 'zoomin' 按钮代码。
  Map1.MousePointer = moZoomIn
  Call selection_enable(False)
  Case "zoomout"
  '应做:添加 'zoomout' 按钮代码。
  Map1.MousePointer = moZoomOut
  Call selection_enable(False)
  Case "pan"
  '应做:添加 'pan' 按钮代码。
  Map1.MousePointer = moPan
  Call selection_enable(False)
  Case "rect"
  '应做:添加 'arrow' 按钮代码。
  Map1.MousePointer = moCross
  Call selection_enable(False)
  Case "globe"
  '应做:添加 'globe' 按钮代码。
  Map1.MousePointer = moDefault
  Map1.Extent = Map1.FullExtent
  End Select
  End Sub
  Private Sub VRen_Click()
  Dim VRen As New MapObjects2.ValueMapRenderer
  With VRen
  '3种类型的山峰
  .ValueCount = 3
  .Field = "type"
  .SymbolType = moPointSymbol
  .Value(0) = "Munro"
  .Value(1) = "Corbett"
  .Value(2) = "Other"
  '设置每种山峰的颜色
  .SymbolType = moPointSymbol
  .Symbol(0).Color = moBlue
  .Symbol(1).Color = moRed
  .Symbol(2).Color = moGreen
  '设置symbol属性
  For i = 0 To .ValueCount - 1
  .Symbol(i).Size = 6
  .Symbol(i).Style = moTriangleMarker
  Next i
  End With
  '将ValueMapRenderer赋值给Maplayer
  Set Map1.Layers(1).Renderer = VRen
  pictureleg.Picture = LoadPicture(App.Path + "classleg.bmp")
  Map1.Refresh
  End Sub
  Private Sub ZRen_Click()
  Dim ZRen As New MapObjects2.ZRenderer
  Dim f_to_m As Double
  f_to_m = 917 / 3000 '将英尺转换为米
  With ZRen
  .BreakCount = 6
  .Break(0) = 1000 * f_to_m
  .Break(1) = 2500 * f_to_m
  .Break(2) = 3000 * f_to_m
  .Break(3) = 3500 * f_to_m
  .Break(4) = 4000 * f_to_m
  .Break(5) = 4500 * f_to_m
  .SymbolType = moPointSymbol
  For i = 0 To .BreakCount - 1
  .Symbol(i).Color = moGray
  .Symbol(i).Style = moTriangleMarker
  .Symbol(i).Size = i * 3
  Next i
  End With
  Set Map1.Layers(1).Renderer = ZRen
  pictureleg.Picture = LoadPicture(App.Path & "/Zleg.bmp")
  Map1.Refresh
  End Sub

上一页  [1] [2] 

责任编辑:小草

文章搜索:
 相关文章
热点资讯
资讯快报
热门课程培训