Share via

Screen reolution detection on Xbox

Shikhar Jain 1 Reputation point
2020-10-28T15:47:20.71+00:00

Hi,

I am trying to detect the screen resolution for the TV/Monitor connected to Xbox One and Xbox One S/X devices, I am using below code

DisplayInformation^ displayInformation = DisplayInformation::GetForCurrentView();

displayInformation->ScreenHeightInRawPixels;displayInformation->ScreenWidthInRawPixels;

But I am getting 1080p as the resolution for all the TV's/Monitor's. But some of these devices doesn't support 1080p resolution itself. Also, when switched the Xbox resolution to 720p, the resolution detected was 1080p.

So, can someone please suggest the API to detect the screen resolution on the Xbox One devices?

Developer technologies | Universal Windows Platform (UWP)

1 answer

Sort by: Most helpful
  1. Anonymous
    2020-10-30T03:02:50.257+00:00

    Hello @Shikhar Jain ,

    Welcome to Microsoft Q&A!

    Is there any API which will allow me to collect the screen resolution of the TV/Monitor?

    If your app is not running in full-screen mode, you might need to get the display device instead and gets the native resolution.

    You could try to use DeviceInformation.CreateWatcher method to enumerate all the display devices and create DisplayMonitor Class for the display class. Then you could check the NativeResolutionInRawPixels property of DisplayMonitor object to get the native resolution.

    I made a simple test on my side on a PC, not an Xbox(because we don't have an Xbox here.). It should work on Xbox as well. Here is the code snippet:

                var deviceSelector = DisplayMonitor.GetDeviceSelector();  
                var devices = await DeviceInformation.FindAllAsync(deviceSelector);  
                foreach (var device in devices)  
                {  
                    Debug.WriteLine("Kind: {0} Name: {1} Id: {2}", device.Kind, device.Name, device.Id);  
                    DisplayMonitor displayMonitor = await DisplayMonitor.FromInterfaceIdAsync(device.Id);  
                    Debug.WriteLine("resolution: " + displayMonitor.NativeResolutionInRawPixels.Width + " x " + displayMonitor.NativeResolutionInRawPixels.Height);  
                }  
    

    Thank you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.