How to resize HoloLens 2D application window size via code

Sadev Kalubowila 10 Reputation points
2024-03-04T11:45:28.4366667+00:00

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?

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,375 questions
Universal Windows Platform (UWP)
C#
C#
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,249 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.
380 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ying Li - MSFT 725 Reputation points Microsoft Vendor
    2024-03-06T05:51:02.6566667+00:00

    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.