Retrieving the DPI of an open screen at runtime.

Question:

At run time, how can I retrieve the DPI of a screen open in an E3Viewer?

Solution:

To do so, you must write a script similar to the example below in a button’s Click() event.

Example:

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\CIMV2”)
Set colItems = objWMIService.ExecQuery(“SELECT * FROM Win32_DesktopMonitor”,,48)
For Each objItem in colItems
MsgBox “PixelsPerXLogicalInch: ” & objItem.PixelsPerXLogicalInch
MsgBox “PixelsPerYLogicalInch: ” & objItem.PixelsPerYLogicalInch
Next

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Deixe seu Comentário

Seu endereço de e-mail não será publicado. Campos marcados com asterisco são obrigatórios *