简体   繁体   English

Windows:如何在高dpi下测试UI?

[英]Windows: How to test UI under high-dpi?

i want to test how my application reacts to high -dpi settings. 我想测试我的应用程序如何对 -dpi设置做出反应。 i don't just mean 120dpi. 我不仅仅意味着120dpi。 i want to test higher dpi settings, such as: 我想测试更高的dpi设置,例如:

  • 150dpi 建议使用150dpi分辨率
  • 300dpi 300DPI
  • 600dpi 600dpi的
  • 1000dpi 1000DPI
  • 1200dpi 1200dpi的

My development machine's video card cannot do the resolutions required to have 300dpi, (or even 150dpi for that matter). 我的开发机器的视频卡无法达到300dpi所需的分辨率(或者甚至150dpi)。

Assuming the interface is designed to ' fit ' on a display with 768 lines (eg 1024x768), the resolution required for the higher-dpi settings would be: 假设接口设计为“ 适合 ”显示器上有768行(例如1024x768),则更高dpi设置所需的分辨率为:

             Normal      Wide-Screen         Frame Buffer
  dpi     Resolution    Resolution    Zoom    Size (MiB)
=======  ============  ============  ======  ============ 
   96     1024 x  768   1280 x  768    100%      3.75     
  113     1200 x  900   1440 x  900    117%      4.96     
  120     1280 x  960   1536 x  960    125%      5.63
  131     1400 x 1050   1680 x 1050    137%      6.73
  150     1600 x 1200   1920 x 1200    156%      8.70
  300     3200 x 2400   3840 x 2400    313%     35.26
  600     6400 x 4800   7680 x 4800    625%    140.63
1,000    10667 x 8000  12800 x 8000  1,042%    390.63

The required resolutions get pretty high, even at 150dpi. 所需的分辨率相当高,即使在150dpi。

i was thinking of something along the line of a running the software on a VirtualPC , with the virtual machine running 6400x4800 - and then use VNC to connect to the virtual machine. 我正在考虑在VirtualPC上运行软件,虚拟机运行6400x4800 - 然后使用VNC连接到虚拟机。 It could then scale the content to fit my monitor. 然后它可以缩放内容以适合我的显示器。 Although i lose the fidelity of a high-dpi display, i can at least look at it, interact with it (ie test it). 虽然我失去了高dpi显示器的保真度,但我至少可以看它,与它进行交互(即测试它)。 But the s3 Trio 32/64 video card that VirtualPC emulates tops out at 1600x1200 (ie 150dpi). 但VirtualPC仿真的s3 Trio 32/64显卡最高可达1600x1200 (即150dpi)。

i also wondered if maybe there is some virtual video card driver out there, that can act like a video card - capable of high-resolution, but displays itself scaled on my native desktop. 我也想知道是否有一些虚拟视频卡驱动程序,它可以像一个视频卡 - 能够高分辨率,但显示自己缩放在我的原生桌面上。

Any ideas? 有任何想法吗?


References 参考

If your app's layout behaves the same at 96, 120, 144, 150 dpi then I think there's no need to test it for even higher DPI, since you will have already tested that it works well for uneven dpi increments. 如果您的应用程序的布局在96,120,144,150 dpi时表现相同,那么我认为没有必要对更高的DPI进行测试,因为您已经测试过它适用于不均匀的dpi增量。

Actually there are many setups high-dpi-friendly already on the market, like 1680x1050 15,4" or 1920x1080 at 16" displays in notebooks, which at 120dpi already show pixel-dependency problems and are pretty uncomfortable to work with at 96dpi already so working on higher-density display support is valid. 实际上市场上已经有很多高dpi友好设置,例如1680x1050 15,4“或1920x1080 16英寸显示器在笔记本电脑中,120dpi已经显示像素依赖性问题,并且已经非常不舒服地使用96dpi致力于更高密度的显示器支持是有效的。 Good for you! 对你有益!

Edit: I've been thinking. 编辑:我一直在想。 That may not be very real-time, but maybe if you tried handling WM_PRINT or WM_PRINTCLIENT messages in your windows and printed it to a file or at least tried to show a print preview of them using printer settings? 这可能不是非常实时,但是如果您尝试在Windows中处理WM_PRINTWM_PRINTCLIENT消息并将其打印到文件或者至少尝试使用打印机设置显示它们的打印预览? Suddenly we're in at least 300dpi. 突然间,我们至少达到300dpi。 Just an idea. 只是一个想法。

I've just tried this with VirtualBox can report the following: 我刚试过VirtualBox可以报​​告以下内容:

  • using a Windows XP host I can't really go beyond about 2000 x 2000, specifying those will simply switch back to 800x600 使用Windows XP主机我不能超过大约2000 x 2000,指定那些将简单地切换回800x600
  • using a Ubuntu 11.04 host I can go to at least 4000x4000. 使用Ubuntu 11.04主机我至少可以使用4000x4000。

Since Windows Vista introduced a new driver model, I wouldn't be suprised if Vista/Windows 7 support those high resolutions as well. 由于Windows Vista引入了新的驱动程序模型,如果Vista / Windows 7也支持这些高分辨率,我不会感到惊讶。 Unfortunately I don't have a Vista or Windows 7 host to test this myself. 不幸的是,我没有Vista或Windows 7主机来自己测试。

The necessary steps are the following: 必要的步骤如下:

  • Switch to scaled display mode (using Host - C , where Host defaults to the right Ctrl key). 切换到缩放显示模式(使用Host - C ,其中Host默认为右Ctrl键)。 this will draw a scaled version of the host display, so there's no need to use the RDP-trick. 这将绘制主机显示的缩放版本,因此不需要使用RDP技巧。 It also ensures that limited window size won't force the VM to reduce the screen resolution 它还确保有限的窗口大小不会强制VM降低屏幕分辨率
  • Use the command-line tool VBoxManage to specify the resolution hint : 使用命令行工具VBoxManage 指定分辨率提示

     VBoxManage controlvm "VM Name" setvideomodehint 4000 4000 32 

You need a video card and a monitor that supports 1920 x 1200. Many users have these, and they're a joy to use if you're a developer. 您需要一个支持1920 x 1200的视频卡和显示器。许多用户拥有这些,如果您是开发人员,他们会很高兴使用它们。 If you have 1600 x 1200 and don't want to spend the money on a new monitor that's fine. 如果您有1600 x 1200并且不想在新的显示器上花钱那么好。 Beyond that, unless you're working for Pixar, I don't see the need. 除此之外,除非你为皮克斯工作,否则我认为没有必要。

As you're already aware, both the NVidia and ATI display cards allow you to create custom resolutions however never in a million years up to 12800 x 8000. Just to give you an idea of how much memory that would take ... it would require 45 times as much memory as a 1080 (1920x1200) video card. 正如您已经知道的那样,NVidia和ATI显示卡都可以让您创建自定义分辨率,但绝不会在一百万年内达到12800 x 8000.只是为了让您了解需要多少内存...它会需要的内存是1080(1920x1200)视频卡的45倍。 What you could do however is get a big honking rig and chain numerous cards together ... even still ... 12800 x 8000 would be something better suited for customer hardware and drivers under LINUX. 然而,你可以做的是获得一个大的鸣喇叭和连接多张卡...甚至仍然... 12800 x 8000将更适合LINUX下的客户硬件和驱动程序。

Windows doesn't check to see if your monitor actually measures to the DPI you configure it for, so just attach the biggest monitor you can and start switching the setting. Windows不会检查您的显示器是否实际测量到您配置的DPI,因此只需连接最大的显示器并开始切换设置。

I'm curious to know why you want to test such high resolutions, ie anything over 192. If you have an actual need for such high resolution, surely you have access to the hardware that will be running it? 我很想知道你为什么要测试这么高的分辨率,即超过192的任何东西。如果你真的需要这么高的分辨率,你肯定可以访问将运行它的硬件吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM