1

I am using two Screens with a FHD resolution. The smaller one is set to 125%. When I try to get the screen resolution of both screens are width or height to small.

var allScreens = new Rectangle();
allScreens = Screen.AllScreens.Aggregate(allScreens,
            (current, screen) => Rectangle.Union(current, screen.Bounds));

Actually 3840*1080 should be returned. However, I get 3456*1080 as the size of both screens. I already tried to get the DPI but without success.

F4ll0ut
  • 309
  • 5
  • 15
  • [Relevant](https://stackoverflow.com/q/5977445/1997232). Not sure which answer to use.. but once you know DPI you can convert `Bounds` to physical pixels. – Sinatr Jun 04 '19 at 14:17
  • @Sinatr The problem with the linked solutions is that they work for one screen, but to my knowledge not for two or more. And I would have to read this value for each screen. The application is only on one of the screens. – F4ll0ut Jun 04 '19 at 14:33
  • [Click](https://stackoverflow.com/q/29438430/1997232). – Sinatr Jun 04 '19 at 14:38
  • @Sinatr I copied the class and gave it a try. Looks promising but I get the values 92 for 100% and 126 for 125%. Shouldn't it be 96 for 100%? – F4ll0ut Jun 05 '19 at 13:00
  • Try to use another [`DpiType`](https://learn.microsoft.com/en-us/windows/desktop/api/shellscalingapi/ne-shellscalingapi-monitor_dpi_type) as per [comment](https://stackoverflow.com/questions/29438430/how-to-get-dpi-scale-for-all-screens#comment75780656_29463627). – Sinatr Jun 05 '19 at 13:27
  • @Sinatr I have tried all three with the following results. Effective: 96 & 96; Angular: 91 & 110; Raw: 92 & 126 – F4ll0ut Jun 05 '19 at 13:35
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/194489/discussion-between-f4ll0ut-and-sinatr). – F4ll0ut Jun 05 '19 at 13:40

0 Answers0