# How to get system display resolution in perspective

**URL:** <https://forum.inductiveautomation.com/t/how-to-get-system-display-resolution-in-perspective/83488>\
**Category:** Ignition\
**Tags:** vision, perspective\
**Created:** [December 23, 2023, 4:57am UTC](https://forum.inductiveautomation.com/t/how-to-get-system-display-resolution-in-perspective/83488 "2023-12-23T04:57:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [December 23, 2023, 4:57am UTC](https://forum.inductiveautomation.com/t/how-to-get-system-display-resolution-in-perspective/83488/1 "2023-12-23T04:57:24Z")

</div>

[https://forum.inductiveautomation.com/t/scripting-with-the-window-size/6145/6?u=manjuyadav95.m](https://forum.inductiveautomation.com/t/scripting-with-the-window-size/6145/6)

I'm getting my system display resolution from vision but not in perspective as it is returning some different resolution ..  
system display resolution is : 1366 \* 768  
Vision o/p: 1366 \* 768  
Perspective o/p: 1024\*768

below code worked in vision but giving different values when used in perspective.. please help

```auto
gd=java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
width = gd.getDisplayMode().getWidth()
height = gd.getDisplayMode().getHeight()
print('width',width,' height',height)
window=system.gui.getParentWindow(event)
window.setSize(int(round(width*0.25)), int(round(height*0.65)))

```

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 23, 2023, 11:10am UTC](https://forum.inductiveautomation.com/t/how-to-get-system-display-resolution-in-perspective/83488/2 "2023-12-23T11:10:08Z")

</div>

I can't see how this would be working at all I Perspective since this library (gui) is for Vision only. In Perspective you can just read the various page props. If you add a property binding on the view, expand the 'page' root prop

---

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [January 4, 2024, 10:08am UTC](https://forum.inductiveautomation.com/t/how-to-get-system-display-resolution-in-perspective/83488/3 "2024-01-04T10:08:11Z")

</div>

expanded page prop but its width is 0 returning in expression binding o/p

---

<div class="post-metadata">

**Author:** ![schenk](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@schenk](https://forum.inductiveautomation.com/u/schenk)\
**Post date:** [January 4, 2024, 12:23pm UTC](https://forum.inductiveautomation.com/t/how-to-get-system-display-resolution-in-perspective/83488/4 "2024-01-04T12:23:50Z")

</div>

The values don't update in the designer because it doesn't have any concept of a page. Try to put this binding on a label and opening it in a browser, you should see values update there.

`'Viewport Width: ' + {page.props.dimensions.viewport.width} + ' Height: ' + {page.props.dimensions.viewport.height}`
