Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Function ConvertTwipsToPixels(_
ByVal twips As Long, _
ByVal isHorizontal As Boolean) As Long
Const TWIPSPERINCH As Long = 1440
Dim gr As Graphics
gr = Me.CreateGraphics
If isHorizontal Then
Return = CLng(lngTwips / TWIPSPERINCH * gr.DpiX)
Else
Return = CLng(lngTwips / TWIPSPERINCH * gr.DpiY)
End If
End Function
Private Sub TestFunction()
Dim myResult as Long
' Convert Horizontal Measurement
myResult = ConvertTwipsToPixels(1440, True)
' Convert Vertical Measurement
myResult = ConvertTwipsToPixels(1440, False)
End Sub