如何關閉縮放比例How to turn off scaling

根據預設,若為 XAML,應用程式會調整為 200%,若為 HTML app 則為 150%。By default, applications are scaled to 200% for XAML and 150% for HTML apps. 您可以關閉預設縮放比例。It is possible to turn off the default scale factor. 這會導致應用程式使用裝置的實際像素尺寸 (1910 x 1080 像素)。This will cause your application to use the actual pixel dimensions of the device (1910 x 1080 pixels).

HTMLHTML

您可以使用下列程式碼片段,選擇不使用縮放比例︰You can opt out of scale factor by using the following code snippet:

var result = Windows.UI.ViewManagement.ApplicationViewScaling.trySetDisableLayoutScaling(true);

或者,您可以使用 Web 適用的方法:Or, you can use a web-friendly method:

@media (max-height: 1080px) {   
    @-ms-viewport {   
        height: 1080px;   
    }   
}   

XAMLXAML

您可以使用下列程式碼片段,選擇不使用縮放比例︰You can opt out of scale factor by using the following code snippet:

bool result = Windows.UI.ViewManagement.ApplicationViewScaling.TrySetDisableLayoutScaling(true);

DirectX/C++DirectX/C++

DirectX/C++ 應用程式不會進行縮放。DirectX/C++ applications are not scaled. 自動縮放僅適用於 HTML 與 XAML 應用程式。Automatic scaling only applies to HTML and XAML applications.

請參閱See also