📄 converters.bas
字号:
Attribute VB_Name = "modConverters"
Option Explicit
Public Const X_AXIS = 0
Public Const Y_AXIS = 1
'
Public Function ConvPrinterPix2FrameInch(ByVal meas As Single, _
ByVal axis As Integer) _
As Integer
'used extensively by AdjustBackgroundPage to convert the
'properties of the Printer from device units to inches
Select Case axis
Case X_AXIS
ConvPrinterPix2FrameInch = (meas * Printer.TwipsPerPixelX) / 1440
Case Y_AXIS
ConvPrinterPix2FrameInch = (meas * Printer.TwipsPerPixelY) / 1440
Case Else
ConvPrinterPix2FrameInch = -1
End Select
End Function
Public Function ConvFrameInch2PrinterPix(ByVal meas As Single, _
ByVal axis As Integer) _
As Integer
'used extensively by cmdPrint_Click to convert the size
'and location of the frames from the page in inches to
'the printer in pixels.
Select Case axis
Case X_AXIS
ConvFrameInch2PrinterPix = (meas * 1440) / Printer.TwipsPerPixelX
Case Y_AXIS
ConvFrameInch2PrinterPix = (meas * 1440) / Printer.TwipsPerPixelY
Case Else
ConvFrameInch2PrinterPix = -1
End Select
End Function
Public Function ConvTwips2Pix(theDevice As Object, _
ByVal meas As Single, _
ByVal axis As Integer) _
As Integer
'Used by optComposePreview to calculate the measurements
'needed to StretchBlt from frmView to mapLayout.
Select Case axis
Case X_AXIS
ConvTwips2Pix = meas / theDevice.TwipsPerPixelX
Case Y_AXIS
ConvTwips2Pix = meas / theDevice.TwipsPerPixelY
Case Else
ConvTwips2Pix = -1
End Select
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -