适用于移动设备的 Flex 4.5:放大高分辨率图像
我正在尝试将缩放/平移功能集成到 iPad 的图像库中(使用 Flash builder 4.5 和 Air mobile sdk 实现),这在纸面上非常简单,使用手势缩放处理和显示图像上的缩放。
我的问题是我有一些媒介&高分辨率图像(约 4096*3072,5Mo 照片),并且在第一次初始手势时,缩放/取消缩放似乎在 iPad 上冻结了很多。一段时间后,一切都会顺利(或者有点顺利:-)。
有谁知道这些冻结的原因是什么以及如何解决这个问题?
非常感谢,
安托万
I am trying to integrate a zoom/pan capability into an image gallery for iPad (implemented with Flash builder 4.5 and Air mobile sdk), which is pretty simple on the paper, using gesturezoom handling and scale on the displayed image.
My problem is that I have some medium & high resolution images (about 4096*3072, 5Mo photo), and that zoom/unzoom seems to freeze a lot on the iPad upon the first initial gestures. After a while, everything goes smooth (or kind of smooth :-).
Does anybody know what is the reason of these freezes, and how to solve this?
Thanks a lot,
Antoine
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用图像的 BitmapData 并将 blit 传输到屏幕大小的容器。
Matrix
类可以帮助您缩放正在绘制到容器的BitmapData
,并且您可以更改Rectangle
的大小作为缩放手势事件的发生是为了从源图像中引入更多像素。这样,您在任何给定时间显示的像素数量都不会超过容器适合的像素数量。I would suggest working with the
BitmapData
of the image and blit to a container the size of the screen. TheMatrix
class can help you to scale theBitmapData
you are drawing to your container and you can change the size of aRectangle
as your scaling gesture events occur to bring in more pixels from the source image. That way you're never displaying more than the amount of pixels that fit into your container at any given time.