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

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

问题描述

我对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.

/ Richard

/Richard

推荐答案

我发现此链接在Silverlight 3中解释 CacheMode 。来自链接:
[此链接已消失。]

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


  • BitmapCache是​​唯一受支持的缓存模式。

  • 将缓存应用于元素及其所有子元素

  • BitmapCaching应该用于混合,变换(平移,拉伸,旋转)的场景。

  • 滥用CacheMode功能可以会损害性能,因此您需要认真考虑自己的工作。如果可视树正在交错缓存和未缓存的元素,则实际上将导致在幕后创建多个渲染图面。未缓存的表面以软件呈现,而缓存的表面以硬件呈现。如果您可以最大程度地减少渲染表面的总数,并使硬件在可以的地方正常工作,那么您的性能将是最好的。

  • 您可以通过添加EnableCacheVisualization参数来确定要缓存的元素。到您的Silverlight插件声明。 <参数名称= EnableCacheVisualization value = true />

  • 据我所知,GPU加速确实当Silverlight应用程序未处于全屏模式时,在Mac上不会发生。显然这是Safari插件模型的局限性。

  • BitmapCache is the only cache-mode that is supported.
  • The Caching is applied to the element and all of it’s child elements.
  • BitmapCaching should be used in scenarios where you are blending, transforming (translating, stretching, rotating).
  • Misuse of the CacheMode feature can hurt performance, so you need to really think through what you are doing. If your visual tree is interleaving cached and un-cached elements, you are effectively causing multiple rendering surfaces to get created behind the scenes. The un-cached surfaces are rendered in software and the cached surfaces are rendered in hardware. Your performance will be best if you can minimize the total number of rendering surfaces and get the hardware to do work where it can.
  • You can determine which elements are being cached by adding the EnableCacheVisualization parameter to your Silverlight plugin declaration. <param name="EnableCacheVisualization" value="true" />
  • As far as I can tell, GPU acceleration does not occur on Macs when the Silverlight application is not in full-screen mode. This is apparently a limitation of the Safari plug-in model.

我想知道 EnableCacheVisualization 可以为WP7启用,我在 LongListPicker 和<$ c $中使用 BitmapCache c> ContentPresenter (我用动态创建的内容填充),知道缓存是否在工作很有趣。但是根据第三个项目符号,只有在对 UIElement s进行动画处理时才应使用它,但我不是,所以也许我不应该在使用它全部!

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!

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

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