?? drawsymbol.cls
字號:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "clsDrawSymbol"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Dim curMap As Object
Dim cursymbol As MapObjects2.symbol
Public Property Get symbol()
End Property
Public Property Set symbol(symbol As MapObjects2.symbol)
'This procedure sets the symbol and draws it to to the map control.
Set cursymbol = symbol
'MsgBox "in set " & cursymbol.Color
End Property
Public Property Get mapControl()
End Property
Public Property Set mapControl(curControl As Control)
Set curMap = curControl
End Property
Public Sub Draw()
'This procedure draws the settings of the current symbol onto
'the map control on the form. A single instance of the symbol
'is drawn in the center of the map.
'These geometric objects are used for drawing symbols
Dim drawLine As New MapObjects2.Line
Dim drawPoint As New MapObjects2.Point
Dim drawPoints As New MapObjects2.Points
Dim drawRect As New MapObjects2.Rectangle
Dim currect As New MapObjects2.Rectangle
Set currect = curMap.Extent
Select Case frmDrawProps.curFeatureType
Case moPoint
'Just make a point and draw it
drawPoint.X = currect.Left + currect.Width / 2
drawPoint.Y = currect.Height / 2
curMap.DrawShape drawPoint, cursymbol
Case moLine
'Add the end points to the points collection
drawPoint.X = currect.Left
drawPoint.Y = currect.Height / 2
drawPoints.Add drawPoint
drawPoint.X = currect.Left + currect.Width
drawPoint.Y = currect.Height / 2
drawPoints.Add drawPoint
drawLine.Parts.Add drawPoints
curMap.DrawShape drawLine, cursymbol
Case moPolygon
'Size the rectangle to be a little smaller than the map.
Dim margin As Integer
margin = 0
drawRect.Top = currect.Top
drawRect.Left = currect.Left
drawRect.Bottom = currect.Bottom
drawRect.Right = currect.Right
curMap.DrawShape drawRect, cursymbol
End Select
End Sub
Public Sub GetBitMap()
frmClipboard.MapToBitmap curMap
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -