Get and Set Screen Resolution

后端 未结 6 1648
灰色年华
灰色年华 2020-11-27 18:07

How can I collect and change screen resolution using Visual C#?

6条回答
  •  Happy的楠姐
    2020-11-27 18:30

    I have spent a lot of time trying to figure this out, for devices with scaling factor is very difficult to get the actual size of the screen due to the scaling factor sometimes 125% or 150% when the calls are made to the C# objects the returning value is not the right now, so you need to make a windows API call to get the scaling factor and apply the multiplier, the only working way that I have found for non WPF apps is here

    https://stackoverflow.com/a/21450169

提交回复
热议问题