如何禁用 Flash Movie AS3 中加载的图像缩放
我有Flash,我在其中动态加载一些图像。
但是当我在大屏幕显示器上查看此闪光灯时,闪光灯会自动缩放(我无法禁用舞台自动缩放)。 同样,图像的尺寸也在增加。 这里出现了问题,在大屏幕显示器上,图像变得模糊。
我怎样才能使它在所有尺寸的显示器上都表现良好。
我想要的只是有选择地禁用图像缩放。
I have Flash, in which i load some images dynamically.
But when I am viewing this flash on a large screen monitor, the flash is auto scaling (I can't disable stage auto scaling). And similarly size of images is also increasing. Here the problem arises, On large screen monitors the images are getting blur.
How can I make it good on all size of monitors.
All here i want is to disable scaling on images selectively.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有内置的可能性...但是此代码将取消缩放任意
DisplayObject
...从这里开始,有很多方法可以完成您想要的...
最简单的方法是,禁用舞台缩放,监听调整大小,然后调整最上面的 DisplayObject 的大小,以适应舞台......优点是,将触发调整大小事件。因此,对于您想要保持不缩放的 DisplayObject,您可以向调整大小事件添加一个监听器,并在调整大小时取消缩放它们……
否则,将一个 DisplayObject 放在舞台上,并在 Enterframe 上观察它的
concatenatedMatrix
...如果 a 和 d(缩放参数)发生变化,那么您就需要调整大小...然后取消缩放您想要取消缩放的所有对象...这是一个额外的操作事件处理程序调用和 Enterframe 上的 2 个浮点比较,因此它不应该成为性能杀手...希望有所帮助...
greetz
back2dos
there is no built-in possibility ... but this code will unscale an arbitrary
DisplayObject
...from here, there are many ways to accomplish, what you want ...
the easiest way would be, to disable stage scaling, to listen on resize, and then resize your topmost
DisplayObject
s, to fit to stage ... the advantage is, that resize event will be triggered ... so forDisplayObject
s that you want to stay unscaled, you add a listener to the resize event and unscale them on resize ...otherwise, put a
DisplayObject
on stage, and watch it'sconcatenatedMatrix
on enterframe ... if a and d (scaling parameters) change, then you have a resize ... then unscale all objects you want to be unscaled ... this is one extra event handler call and 2 float comparisons on enterframe, so it shouldn't be a performance killer ...hope that helps ...
greetz
back2dos