How to get vision client resolution


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

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()

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


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.