title: How does Silverlight Image Clipping work?
body: <p>I've got a very large image which I'd like to use for sprite techniques (à la <a href="http://css-tricks.com/css-sprites/" rel="nofollow noreferrer">css image sprites</a>).</p>
  
  <p>I've got the code below:</p>
  
  <pre><code>&lt;Image x:Name="testImage" Width="24" Height="12" Source="../Resources/Images/sprites.png"&gt;
       &lt;Image.Clip&gt;
           &lt;RectangleGeometry Rect="258,10632,24,12" /&gt;
       &lt;/Image.Clip&gt;
  &lt;/Image&gt;
  </code></pre>
  
  <p>This clips the source image to 24x12 at the relative position of 258, 10632 in the source image.</p>
  
  <p>The problem is that I want the cropped image to show at 0,0 in the testImage whereas it shows it at 258, 10632. It's using the geometry as a <em>cutting guide but also as a layout guide</em>.</p>
  
  <p>Anyone have any idea how this should be done? <em>if at all</em>.</p>
  
  <p><strong>Conclusion:</strong>
  There seems to be no good way of doing this at present, Graeme's solution seems to be the closest to achieving this with Silverlight 2.0.</p>
  
  <p><em>That said, if anyone knows of a better way of doing this, please reply with an answer.</em></p>