铁锅老是生锈怎么办?:请vb高手帮忙,这段代码的流程图是什么?

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/30 02:53:42
代码如下:

'测距:
Private Sub Command3_Click()
Dim ipcommand As ICommand
If m_blInUse = False Then
m_blInUse = True
m_flagMousedown = 2 '''测两点之间距离

SceneControl1.MousePointer = esriPointerCrosshair
Set ipcommand = New ControlsSceneSelectGraphicsTool

ipcommand.OnCreate (SceneControl1.Object)
If ipcommand.Enabled = True Then
Set SceneControl1.CurrentTool = ipcommand
End If

Else
m_blInUse = False
m_flagMousedown = 0
SceneControl1.MousePointer = esriPointerDefault

End If
End Sub

Private Sub SceneControl1_OnMouseDown(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
Dim pt As IPoint
Dim pFeature As IFeature
Dim pLayer As ILayer
Dim ipPoint As IPoint
Dim ipFeature As IFeature
Dim ipLayer As ILayer

Select Case m_flagMousedown
Case 2: '''测两点之间的距离,m_flagMoudown由测距按钮单击事件设定
Set m_Pt1 = LocatePointInScene(SceneControl1.Scene, x, y, esriScenePickAll)
If m_Pt1 Is Nothing Then Exit Sub
m_bCapture = True

m_Pen = CreatePen(RGB(0, 255, 255), 2, 0) 'A solid, width of 2 black pen
m_Brush = GetStockObject(5) 'A hollow brush
Set pScene = Me.SceneControl1.Scene
Dim pSceneViewer As ISceneViewer
Set pSceneViewer = pScene.SceneGraph.ActiveViewer
Set m_ltPt = New Point
m_ltPt.x = x
m_ltPt.y = y
m_oldpt.x = x
m_oldpt.y = y
m_lDrawMode = GetROP2(pSceneViewer.hdc)
'GDI calls to select pen and brush objects into the device
SelectObject pSceneViewer.hdc, m_Pen
SelectObject pSceneViewer.hdc, m_Brush
'GDI call to set the draw mode of the device
SetROP2 pSceneViewer.hdc, 14 'R2_NOTXORPEN inverse of pen and screen colours combined
SetCapture pSceneViewer.hWnd

End Select

End Sub

Private Sub SceneControl1_OnMouseUp(ByVal button As Long, ByVal shift As Long, ByVal x As Long, ByVal y As Long)
m_blInUse = False
m_bCapture = False

Select Case m_flagMousedown
Case 2: '''测距
Set m_Pt2 = New Point
Set m_Pt2 = LocatePointInScene(SceneControl1.Scene, x, y, esriScenePickAll)

If (Not m_Pt1 Is Nothing) And (Not m_Pt2 Is Nothing) Then
Dim dDistance As Double
dDistance = GCircleDistance(m_Pt1.x, m_Pt1.y, m_Pt2.x, m_Pt2.y)
m_bDragging = False

MsgBox "the distance is " & VBA.Format(dDistance, "#####.###") & " meters"
Else
MsgBox "ERROR: please select the features"
End If

End Select

End Sub

我对这个一窍不通,请大家帮帮忙~~谢谢!!!!
能给我发邮件么?
11867183@163.com
非常感谢!

是ESRI二次开发啊,百度上面不能绘制流程图啊