[UWP] [Xbox]本地机器和Xbox One之间的窗口大小差异 [英] [UWP][Xbox]Window Size difference between Local Machine and Xbox One

查看:84
本文介绍了[UWP] [Xbox]本地机器和Xbox One之间的窗口大小差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我已经通过在VS中选择新项目获取了可用的示例代码。我开始使用UWP DirectX11应用程序并删除了2个场景。我创建了一个场景,它将一些Direct2D输出到屏幕上。现在我有了它的工作方式,如果我在Local Machine中运行,但是当我在xbox上运行时,我想要
它。似乎GetOutputSize()函数返回的分辨率大小是其两倍。如果我将宽度和高度除以2,我可以让
XBOX上的布局看起来不错,但是然后它会在我的本地计算机上被破坏。有没有办法用ifdef或if语句确定它运行的是什么?我认为这将是一种解决问题的方法。有什么我可能忽略的吗?

Hello, I have taken the sample code that is available by choosing new project in VS. I started with the UWP DirectX11 app and stripped out the 2 scenes. I created a scene which does some Direct2D output to the screen. Now I have it working how I would like it if I run in Local Machine however when I run it on the xbox one. It appears that the GetOutputSize() function returns some size that is double the resolution or something. If I divide the width and height  by 2, I can get the layout to look ok on the XBOX however it is then broken on my Local Machine. Is there a way to determine what it is running on with some ifdef or if statements? I suppose that would be a way of working around the issue. Is there anything that I may have overlooked?

感谢您在高级方面的帮助,

Thanks for your help in advanced,

C1ubb

推荐答案

嗨C1ubb,

Hi C1ubb,

似乎是分辨率XBOX与本地计算机的分辨率不同。 

It seems the resolution of the XBOX is different from the resolution of your Local Machine. 

有关于使用XAML定义页面布局的官方文档,请在此链接中查看:  https://msdn.microsoft.com/en-us/windows/uwp/layout/ layouts-with-xaml

There is an official document about Define page layouts with XAML, please refer it in this link: https://msdn.microsoft.com/en-us/windows/uwp/layout/layouts-with-xaml.

XAML为您提供灵活的布局系统,允许您使用自动调整大小,布局面板,可视状态,甚至单独的UI定义创建响应式UI。通过灵活的设计,您可以在具有不同app
窗口大小,分辨率,像素密度和方向的屏幕上使您的应用看起来很棒。

还有什么是你的页面布局?还有,请你分享一个简单的转载项目,它将帮助我们更清楚地分析和诊断这个问题。

Also what is your layout in your page? Also would you please share us a simple reproduced project, it will help us analyze and diagnose this issue more clearly.

最诚挚的问候,

Jayden Gu

Jayden Gu


这篇关于[UWP] [Xbox]本地机器和Xbox One之间的窗口大小差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆