VB The properties Screen.TwipsPerPixelX and Screen.TwipsPerPixelY are missing in MS Access. is there any way to replace them?
Here's the code:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long | |
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hDC As Long) As Long | |
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long | |
Private Const LOGPIXELSX = 88 | |
Private Const LOGPIXELSY = 90 | |
' Converts twips corrdinates to pixels coordinates | |
Private Sub Twips2Pixels(X As Long, Y As Long) | |
Dim hDC As Long | |
hDC = GetDC(0) | |
X = X / 1440 * GetDeviceCaps(hDC, LOGPIXELSX) | |
Y = Y / 1440 * GetDeviceCaps(hDC, LOGPIXELSY) | |
ReleaseDC 0, hDC | |
End Sub |
Komentar