title: WPF RenderTargetBitmap Missing Elements
body: <p>I have a TreeView with small icons displayed in the data template.  I'm trying to save the Treeview as a PNG using RenderTargetBitmap.  </p>
  
  <p>The image saves correctly on small data sets.  However, if the data set becomes too large, some of the icons are excluded from the final image. The magic number seems to be 200 items.  It doesn't seem to matter if the tree is deep or wide, after 200 items, the icons are not rendered.</p>
  
  <p><strong>Added Code</strong></p>
  
  <p>So here is my code that I'm using to create an image.  </p>
  
  <pre><code>        RenderTargetBitmap targetBitmap = new RenderTargetBitmap(
              (int)_treeView.ActualWidth,
              (int)_treeView.ActualHeight,
              96, 96, PixelFormats.Default);
  
          targetBitmap.Render(_treeView);
  </code></pre>
  
  <p><strong>Added Screen Shot</strong></p>
  
  <p>Notice the missing icons way over on the right side of the tree.
  <a href="https://i.stack.imgur.com/EQy9F.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/EQy9F.jpg" alt="Screen shot of missing icons"></a></p>
  
  <p>Now if I collapse a few branches, thus hiding some of the other icons, then these icons are included.  It's almost like RenderTargetBitmap.Render doesn't have the power to render all of the icons.  Or it may have something to do with virtual panels.
  <a href="https://i.stack.imgur.com/RzEMw.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/RzEMw.jpg" alt="Screen shot of included icons"></a></p>
  
  <p>Here is a closer look.
  <a href="https://i.stack.imgur.com/v8jYE.png" rel="noreferrer"><img src="https://i.stack.imgur.com/v8jYE.png" alt="enter image description here"></a></p>