How to get vision client resolution

Hello

Is there any way to get vision client session resolution?

1 Like

Thanks Jordan
How about scaling factor in windows? For Hi Res Display 4K, windows impose some sort of scaling (200%). Is there any way to get scale factor?

Updated. Note this this doesn’t work in Java 8, as it always returns 100% scaling, for some reason. Java 11 seems to be okay. :man_shrugging:

import java.awt

gd=java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
width = gd.getDisplayMode().getWidth()
height = gd.getDisplayMode().getHeight()

dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution()

tf = gd.getDefaultConfiguration().getDefaultTransform()

print 'resolution:', width, 'x', height
print 'dpi:', dpi
print 'scaleX:', tf.getScaleX()
print 'scaleY:', tf.getScaleY()
5 Likes

Hello Jordan,
Does this script go in the project startup section?

Thanks!

Hi Julio,

I think it could be placed about anywhere, although the startup script fires before there is any window open. I placed mine in the internalFrameActivated event of a window.