简体   繁体   English

如何在Adobe AIR中动态检测屏幕分辨率变化

[英]how to detect screen resolution changes dynamically in adobe AIR

Screen class in actionscript provides the latest total screen bounds and available screen bound, but doesn't allow to attach listener to listen for changes on runtime. actionscript中的Screen类提供了最新的总屏幕边界和可用的屏幕边界,但是不允许附加侦听器以侦听运行时的更改。

is there any way of detecting screen resolution changes on runtime, it is required to size the application whenever screen resolution is changed. 有什么方法可以在运行时检测屏幕分辨率的变化,只要屏幕分辨率发生变化,就需要调整应用程序的大小。 eg in case when machine display is connected to projector/high resolution monitor and then switched back to normal. 例如,当机器显示屏连接到投影机/高分辨率监视器,然后又切换回正常状态时。

thanks, 谢谢,

There are several solutions: 有几种解决方案:

  • If your window is maximized, you can listen to any of various RESIZE events (see you comp. events list) 如果窗口最大化,则可以收听各种RESIZE事件中的任何一个(请参阅压缩事件列表)
  • You can create invisible maximized window and listen to it's resize event 您可以创建不可见的最大化窗口并收听其调整大小事件
  • You can check screen resolution on timer (eg every 1 second). 您可以检查计时器的屏幕分辨率(例如,每1秒钟)。 It will not decrease the performance. 它不会降低性能。

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

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