How to find the screen size of two monitors using wx.displaySize()
Asked Answered
A

1

8

I want to get the screen size for two monitors using wxPython.

To get the screen size of one monitor: (screenSize is [] containing x and y value).

screenSize = wx.DisplaySize()

but I want something that will work for multiple monitors like the following:

screenSizeMonitor1 = wx.DisplaySize()
screenSizeMonitor2 = wx.DisplaySize()

If possible, it would be nice to know which monitor is on the left (if using two monitors) and which is on the right.

Albertina answered 24/4, 2012 at 9:7 Comment(0)
H
16

You can use the GetGeometry() method of the wx.Display class:

displays = (wx.Display(i) for i in range(wx.Display.GetCount()))
sizes = [display.GetGeometry().GetSize() for display in displays]

To determine the leftmost monitor, you only have to compare the left coordinates of the wx.Rect instances returned by GetGeometry(). The monitor with the smallest left coordinate is the leftmost one.

Hire answered 24/4, 2012 at 9:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.