How to resize HoloLens 2D application window size via code

Sadev Kalubowila 10 Reputation points

I want to customize windows size of my 2D HoloLens UWP application. I have tried below code in my .NET application. This doesn't work in HoloLens, but it works in Windows PC.

ApplicationView.PreferredLaunchViewSize = new Windows.Foundation.Size(950, 800);
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

How to resize the 2D UWP HoloLens Application's window size?

Microsoft Technologies based on the .NET software framework.
3,323 questions
Universal Windows Platform (UWP)
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,158 questions
HoloLens Development
HoloLens Development
HoloLens: A family of Microsoft self-contained, holographic devices that enable engagement with digital content and interaction with holograms in the surrounding environment.Development: The process of researching, productizing, and refining new or existing technologies.
379 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ying Li - MSFT 640 Reputation points Microsoft Vendor

    Hello, Welcome to Microsoft Q&A,

    Windows Mixed Reality runs all 2D apps at a fixed resolution and DPI that equates to 853x480 effective pixels, regardless of window size, so this is what you should design for. Please refer to Updating 2D UWP apps for Windows Mixed Reality - Mixed Reality | Microsoft Learn for more information.

    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.