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.
The size of a screen is usually described by the length of its diagonal, which is the distance between opposite corners, usually in inches. It is also sometimes called the physical image size to distinguish it from the "logical image size," which describes a screen's display resolution and is measured in pixels.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With