title: Extract Clip from WPF Canvas
body: <p>I'm having issues trying to not only clip, but to &quot;extract&quot; a portion of a WPF Canvas. So basically I would like the &quot;Clip&quot; to expand to the full size of the window, or convert the clipped item to separate UI Element for exporting to PNG. I write pseudocode because the real code comes from an Autocad model.</p>
  <pre><code>double oPrintWidth=1169;
  
  Canvas c = new Canvas();
   
  c.Width = oPrintWidth * 2.54;
  c.Height = c.Width * ratio;
  
  // Define the path to clip
  string thisPathData = &quot;M12233 M222333 M3443&quot; // fake
  c.Clip = Geometry.Parse(thisPathData);
  </code></pre>
  <p>At this point I have the same size canvas but everything other than my path is now black. And the path is still in the original position. I need to now make the clip the entire canvas.</p>
  <p>I have played with RenderTransform but I'm lost as what to do next, I'm not so good with matrix calculations.</p>
  <p><strong>Original Canvas</strong> (Collection of UI Elements)</p>
  <p><img src="https://i.stack.imgur.com/tjuM7.png" alt="BeforeClip" /></p>
  <p><strong>AFTER CLIP</strong></p>
  <p><img src="https://i.stack.imgur.com/gB0KD.png" alt="ClippedImage" /></p>
  <p><strong>DESIRED RESULT</strong></p>
  <p><img src="https://i.stack.imgur.com/asAPk.png" alt="DesiredResult" /></p>
  <p>Ultimately this would be printed but would prefer to keep it in WPF until last minute to retain VECTOR properties for translating to SVG/XPS/ETC</p>