位图缓存?何时以及如何使用? [英] BitmapCache? When and how to use?

查看:24
本文介绍了位图缓存?何时以及如何使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于 Windows Phone 7 silverlight 应用程序中位图缓存的问题.

I have a question about bitmap caching in windows phone 7 silverlight applications.

我什么时候使用它?在什么控件上?我应该位图缓存位图缓存的控件的子项吗?我不确定它是如何工作的,如果能从你们那里得到一些建议会很高兴.

When shall i use it? And on what controlls? Should i bitmap cache children of a controll thats bitmap cached? I'm not sure how its works and it would be nice to get some advice from you guys.

/理查德

推荐答案

我发现了 此链接 解释 Silverlight 3 中的 CacheMode.来自链接:[此链接已失效.]

I found this link explaining CacheMode in Silverlight 3. From the link: [This link is dead.]

  • BitmapCache 是唯一受支持的缓存模式.
  • 缓存应用于元素及其所有子元素.
  • BitmapCaching 应该用于混合、变换(平移、拉伸、旋转)的场景.
  • 滥用 CacheMode 功能会损害性能,因此您需要认真考虑自己在做什么.如果您的可视化树交错缓存和未缓存的元素,您实际上会导致在幕后创建多个渲染表面.未缓存的表面在软件中呈现,缓存的表面在硬件中呈现.如果您可以最大限度地减少渲染表面的总数并让硬件尽其所能地工作,那么您的性能将是最佳的.
  • 您可以通过将 EnableCacheVisualization 参数添加到 Silverlight 插件声明中来确定正在缓存哪些元素.
  • 据我所知,当 Silverlight 应用程序未处于全屏模式时,Mac 上不会发生 GPU 加速.这显然是 Safari 插件模型的一个限制.

我想知道是否可以为 WP7 启用 EnableCacheVisualization,我将 BitmapCache 用于 LongListPickerContentPresenter(我用动态创建的内容填充)并且知道缓存是否有效会很有趣.但是根据第三个要点,只有在为 UIElement 设置动画时才应该使用它,而我没有,所以也许我根本不应该使用它!

I wonder if the EnableCacheVisualization can be enabled for WP7, I'm using BitmapCache for a LongListPicker and a ContentPresenter (that I populate with dynamically created content) and it'd be interesting to know if the caching is working. But according to the 3rd bullet, you should be using it only if you're animating UIElements, which I'm not, so maybe I shouldn't be using it at all!

这篇关于位图缓存?何时以及如何使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆