关于 flex3:Limit filter to visible screen – Actionscript 3

更新时间:2024-04-26 下载TXT文档 下载Word文档

我目前在 FlexSDK/AS3 中工作,并且有一个包含许多对象的画布。画布很大——大约 4K x 4K 像素,我做了很多缩放/缩放/滚动。视口只有 800x450 左右。

我正在尝试在画布上应用模糊滤镜 - 我已经弄清楚了,它工作正常,除了这个小错误:

A filter is not applied if the resulting image exceeds the maximum dimensions. In AIR 1.5 and Flash Player 10, the maximum is 8,191 pixels in width or height, and the total number of pixels cannot exceed 16,777,215 pixels. (So, if an image is 8,191 pixels wide, it can only be 2,048 pixels high.) In Flash Player 9 and earlier and AIR 1.1 and earlier, the limitation is 2,880 pixels in height and 2,880 pixels in width. If, for example, you zoom in on a large movie clip with a filter applied, the filter is turned off if the resulting image exceeds the maximum dimensions. -- AS3 docs

当我缩小我的过滤器工作正常。但是在放大时,像素限制被打破,过滤器无法工作。

由于我只需要模糊屏幕的当前可见部分 - 800x450 切片 - 有什么方法可以选择性地只模糊屏幕的那部分? 短码网=DuanMa.NET

我认为您不能分配 DisplayObject 的一个区域来应用过滤器。要么全有,要么全无。

画布的内容有多复杂?元素是交互的吗?你能把它们分成更小的矩形,然后放到一个网格中吗?

如果它只是一个图像或一组图像,您可以将可视部分复制到 BitmapData 对象中。您将隐藏大画布并仅使用位图对象显示位图数据。您可以在缩放和滚动事件上添加一个侦听器,然后在必要时更新 BitmapData 和 Bitmap。

如果是一组交互式控件,我认为最好的选择是将它们组合成一个网格。然后,您可以对网格中的所有单元格应用模糊处理(每个单元格的尺寸都较小)。

请注意,模糊这么多像素将是真正的性能消耗!

以上就是短码网小编为大家整理的《关于 flex3:Limit filter to visible screen – Actionscript 3》相关内容,希望大家喜欢。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。

如若内容造成侵权/违法违规/事实不符,请将联系本站反馈,一经查实,立即处理!

关于 flex3:Limit filter to visible screen – Actionscript 3》文档下载仅供参考学习,下载后请在24小时内删除。

转载注明出处:https://www.duanma.net/article/ebc1ec72799.html

回到顶部