selection.bas
来自「ao开发指南的东西 源码 希望大家好好学习ao」· BAS 代码 · 共 25 行
BAS
25 行
Attribute VB_Name = "Utilities"
Option Explicit
' Variables used by the Error handler function - DO NOT REMOVE
Const c_ModuleFileName = "Utilities.bas"
Public Declare Function GetKeyState% Lib "user32" (ByVal nKey%)
Public Function ConvertPixelsToMapUnits(pActiveView As esriCore.IActiveView, pixelUnits As Double) As Double
On Error GoTo ErrorHandler
Dim realWorldDisplayExtent As Double
Dim pixelExtent As Integer
Dim sizeOfOnePixel As Double
pixelExtent = pActiveView.ScreenDisplay.DisplayTransformation.DeviceFrame.Right - pActiveView.ScreenDisplay.DisplayTransformation.DeviceFrame.Left
realWorldDisplayExtent = pActiveView.ScreenDisplay.DisplayTransformation.VisibleBounds.Width
sizeOfOnePixel = realWorldDisplayExtent / pixelExtent
ConvertPixelsToMapUnits = pixelUnits * sizeOfOnePixel
Exit Function
ErrorHandler:
HandleError True, "ConvertPixelsToMapUnits " & c_ModuleFileName & " " & GetErrorLineNumberString(Erl), Err.Number, Err.Source, Err.Description, 1
End Function
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?