title: Silverlight + Bitmapcache: can't get it to work
body: <p>I'm optimizing a silverlight application which uses a lot of images (GIS style, display tiled images, zoom/pan/etc.), and I was thinking of using the bitmapcaching functionality which should offload a bunch of things to the GPU.</p>
  
  <p>However, I can't seem to get it to work. My host page contains the correct params (I think?):</p>
  
  <pre class="lang-html prettyprint-override"><code>    &lt;object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%"&gt;
          &lt;param name="EnableCacheVisualization" value="true" /&gt;
          &lt;param name="EnableGPUAcceleration" value="true" /&gt;
          &lt;param name="EnableFramerateCounter" value="true" /&gt;
        &lt;param name="source" value="ClientBin/BitmapCaching.xap"/&gt;
        &lt;param name="onError" value="onSilverlightError" /&gt;
        &lt;param name="background" value="white" /&gt;
        &lt;param name="minRuntimeVersion" value="5.0.61118.0" /&gt;
        &lt;param name="autoUpgrade" value="true" /&gt;
        &lt;a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=5.0.61118.0" style="text-decoration:none"&gt;
            &lt;img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/&gt;
        &lt;/a&gt;
      &lt;/object&gt;
  </code></pre>
  
  <p>And my xaml should enable caching as well:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;UserControl x:Class="BitmapCaching.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      d:DesignHeight="300" d:DesignWidth="400"&gt;
  
      &lt;Grid x:Name="LayoutRoot" Background="White" CacheMode="BitmapCache"&gt;
          &lt;Rectangle x:Name="img" Width="200" Height="200" Stroke="Black"&gt;
              &lt;Rectangle.Fill&gt;
                  &lt;ImageBrush ImageSource="/BitmapCaching;component/download.jpg" /&gt;
              &lt;/Rectangle.Fill&gt;
              &lt;Rectangle.RenderTransform&gt;
                  &lt;RotateTransform /&gt;
              &lt;/Rectangle.RenderTransform&gt;
          &lt;/Rectangle&gt;
          &lt;Button Content="Scale" Height="40" Width="100" Click="Button_Click" /&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>(yes, I know it's not smart to put the cachemode on the root element)</p>
  
  <p>However, when I launch the application, The complete application shows up with a red tinted overlay. This should indicate that there's nothing being cached.</p>
  
  <p>I've read that you need a recent driver for your GFX card, but that should be fine. This machine has an ATI Radeon HD5450 videocard with recent drivers. I can't imagine that's not enough?</p>
  
  <p>I'm stumped. If anyone knows how to solve this, please, save me from going insane!</p>