Flex 4 Spark 模糊滤镜问题
我正在尝试创建自己的模态窗口(内置的弹出管理器不适用于此应用程序)并使窗口后面的对象变得模糊。下面的代码显然是错误的,因为它不起作用,但有人可以指出我正确的方向吗?我是否必须手动模糊窗口后面的每个对象?
<s:Button label="Testing" left="512" top="300">
</s:Button>
<s:Rect width="1024" height="768" alpha=".5">
<s:fill>
<s:SolidColor color="#000000">
</s:SolidColor>
</s:fill>
<s:filters>
<s:BlurFilter>
</s:BlurFilter>
</s:filters>
</s:Rect>
I'm trying to create my own modal window (the built in popup manager won't work for this application) and get objects behind the window to be blurred. The code below is obviously wrong since it doesn't work but can someone point me in the right direction? Do I have to manually blur each object behind the window?
<s:Button label="Testing" left="512" top="300">
</s:Button>
<s:Rect width="1024" height="768" alpha=".5">
<s:fill>
<s:SolidColor color="#000000">
</s:SolidColor>
</s:fill>
<s:filters>
<s:BlurFilter>
</s:BlurFilter>
</s:filters>
</s:Rect>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的代码显然只会模糊那个黑色矩形,而不是其他任何东西。这里的问题是您想要模糊整个应用程序(模式窗口除外)。
我可以想到两种解决方案:
解决方案 1
将整个应用程序放在一个单独的类中,并将过滤器应用于该类:(
这不是一个工作代码示例:其目的只是传达想法)
< strong>解决方案2
在窗口弹出之前截取应用程序的屏幕截图(创建位图)。将该图像放在您的应用程序上,然后将模糊滤镜应用到该图像。然后放置模态窗口。由于图像覆盖了所有内容,因此您无法单击任何内容,但这正是您希望模态窗口出现的行为。
Your code is obviously just going to blur that black rectangle and nothing else. The issue here is that you want to blur the entire application, except the modal window.
I can think of two solutions:
solution 1
Put your entire application in a separate class and apply the filter to that:
(this is not a working code sample: its purpose is just to convey the idea)
Solution 2
Take a screenshot of your app (create a BitMap) before the window pops up. Place that image over your app and apply the blur filter to that image. Then place the modal window. You couldn't click on anything because of the image overlaying everything, but that's the behavior you want from a modal window.