# How to get vision client resolution

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328>\
**Category:** Ignition\
**Created:** [August 10, 2019, 8:25am UTC](https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328 "2019-08-10T08:25:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [August 10, 2019, 8:25am UTC](https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328/1 "2019-08-10T08:25:12Z")

</div>

Hello

Is there any way to get vision client session resolution?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 10, 2019, 12:08pm UTC](https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328/2 "2019-08-10T12:08:35Z")

</div>

> [@Scripting with the window size](http://forum.inductiveautomation.com/t/scripting-with-the-size/6145/4):
>
> Sorry, couldn’t let this one pass… This one will get screen resolution for you. import java.awt gd=java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() width = gd.getDisplayMode().getWidth() height = gd.getDisplayMode().getHeight()

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [August 10, 2019, 1:40pm UTC](https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328/3 "2019-08-10T13:40:29Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 12, 2019, 12:06pm UTC](https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328/4 "2019-08-12T12:06:54Z")

</div>

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. 🤷‍♂️

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

---

<div class="post-metadata">

**Author:** ![julio.velasco](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/julio.velasco/32/9413_2.png) [@julio.velasco](https://forum.inductiveautomation.com/u/julio.velasco)\
**Post date:** [October 20, 2020, 1:00am UTC](https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328/5 "2020-10-20T01:00:34Z")

</div>

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

Thanks!

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 20, 2020, 8:34am UTC](https://forum.inductiveautomation.com/t/how-to-get-vision-client-resolution/27328/6 "2020-10-20T08:34:27Z")

</div>

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.
