I plan to use a background image for each of my pages in WP7 and not keep the background transparent.
Any suggestions or issues开发者_JAVA百科 I need to be aware of?Also, I noticed a CacheMode
property.
2 steps:
(1)
in
<phone:PhoneApplicationPage
set shell:SystemTray.IsVisible = "False"
(2)
<Grid x:Name="LayoutRoot">
<Grid.Background>
<ImageBrush ImageSource="Assets/Images/Flowers.png"></ImageBrush>
</Grid.Background>
You can create an Image control sized to full the display and lay your other controls in front of it.
If there is a reason you expect this control to be redrawn, then bitmap caching will save you the overhead of rasterising the control repeatedly.
You can put it on the PhoneApplicationFrame instead of puttin it on each page: it will then load only once and for all...
There are a couple of performance issues you should be aware of:
1) Ensure large images are compiled as Content
and not Resources
. Compiling as Resource
will build the image into the binary executable itself, which makes it much larger to load in to memory on startup.
Jeff Wilcox:
If you’re using Panorama, a Resource background will load immediately compared to Content
2) Unless you really need transparency use .jpg files rather than .png. The .jpg decoding algorithm is significantly faster than .png. However beware of compression. What is a tiny image on disk consume much more memory once it has been decompressed in memory.
精彩评论