Learning from Windows Phone development-cachemode

Source: Internet
Author: User

Develop Windows Phone 8 applicationsProgramSometimes, the page needs to load a lot of graphs to become very card, the solution is to use GPU for acceleration, but the SDK has provided developers with an interface, you only need to write the image label in the XAML File

 
Cachemode = "bitmapcache"

For example:

 
<Phone: panoramaitem header = "item5"> <image cachemode = "bitmapcache"> <image. source> <bitmapimage urisource = "/assets/4.png" createoptions =" backgroundcreation "/> </image. source> </image> </Phone: panoramaitem>

After rewriting, it seems that the interface is not so stuck. On the Internet, there is an explanation provided by Microsoft developers: the original article is here.

Hi Andy,

Response from our development team:

Whether everything is rendered by the GPU or not is not directly related to whether cachemode is useful. Most WPF applications
Render everything on the GPU as well, and cachemode can be exceptionally useful there when used judiciously. the cachemode API allows developers to collapse costly parts of the scene into a texture. this incurs some upfront cost, sometimes more CPU and/or
GPU time than it wowould normally take to render that scene directly to the screen, and some persistent memory cost associated with storing the realized content. the trade-off is that rendering that content subsequently is much improved-it becomes limit tively
As cheap as rendering a single image, no matter how complex the uielement tree. this can be important beyond computation time as well. on lower-end devices with limited GPU bandwidth, collapsing a scene with lots of overlapping content into a single image
Reduces overdraw and bandwidth, which can ultimately improve the frame-rate.

some other points worth mentioning:
• There are no limitations as there are in Silverlight 5 regarding needing to cache a uielement in order to have animations targeting it run independently. there are, however, some related new limitations-Animations inside a cached part of the element tree
are disabled by default.

• It's important to stress that this API shocould be used carefully. sprinkling cachemode all over an application can often reduce run-time performance and greatly increase memory usage (especially if the content is frequently updated, which is one of the driving
Motivations behind animations inside a cached tree being disabled). It's best to profile to determine which targeted areas are most expensive to render, And to experiment with caching based on those results.

Matt small-Microsoft escalation engineer-Forum moderator
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.