title: What's wrong with my bitmap? How to get pixel data of what I drew?
body: <p>Here's my buffer for an animation:</p>
  
  <pre><code>Bitmap PixBuffer;
  </code></pre>
  
  <p>Here's how I create it:</p>
  
  <pre><code>PixBuffer = new Bitmap(ClientRectangle.Width, ClientRectangle.Height, PixelFormat.Format32bppArgb);
  </code></pre>
  
  <p>Here's how I draw on it:</p>
  
  <pre><code>Graphics Renderer { get { return Graphics.FromImage(PixBuffer); } }
  </code></pre>
  
  <p>To make long story short. It works. I draw. I see changes. I use the bitmap as <code>BackgroundImage</code> for a window. Since the window has <code>DoubleBuffered</code> = <code>true</code>, it's silky smooth and fast.</p>
  
  <p>OK, and the WTF part. I try to clone a slice of my bitmap, or even whole thing:</p>
  
  <pre><code>PixBuffer = (Bitmap)PixBuffer.Clone();
  </code></pre>
  
  <p>It doesn't make much sense, it should do nothing with what's displayed. But guess what - the clone is EMPTY! Exactly the same result if I try to draw <code>PixBuffer</code> on a new bitmap. The contents of PixBuffer is displayed. It can be even stretched as windows background. But I see no way to copy it. <code>RotateFlip</code> has no effect too.</p>
  
  <p>What am I doing wrong? How to get pixel data of what I drew?</p>
  
  <pre><code>                Freeze = (Bitmap)PixBuffer.Clone();
                  using (var g = Graphics.FromImage(Freeze)) {
                      g.FillRectangle(BrushF, 0, 0, 100, 100);
                      g.CompositingMode = CompositingMode.SourceOver;
                      g.Dispose();
                  }
                  var test = (Bitmap)Freeze.Clone();
                  BackgroundImage = test;
  </code></pre>
  
  <p>When I set <code>PixBuffer</code> as <code>BackgroundImage</code> - I get my drawn image. When I set <code>Freeze</code> as <code>BackgroundImage</code> - I get a square.</p>
  
  <p>Then, if I clone <code>Freeze</code> to let's say <code>Freeze1</code> - I still get my square, so cloning actually works on some bitmaps. But on PixBuffer NO JOY!</p>
  
  <p>PixBuffer is not drawn in one frame. It is drawn as progressing animation during ca 30s. After animation completes - I have still screen - this screen I want to have as a normal bitmap to manipulate (like scaling and such). It seems like PixBuffer is write-only. I can still draw on it, but I can't copy anything from it.</p>
  
  <p>I even tried to convert it to <code>Icon</code> and then back to <code>Bitmap</code> - but it's exactly the same like I was doing operations on empty <code>Bitmap</code> object.</p>
  
  <p>But it IS NOT EMPTY! I tested it. I removed the <code>BackgroundImage</code>. I set another image in its place. And then I set <code>PixBuffer</code> as <code>BacgroundImage</code> again - and it is not empty, there is all I drew.</p>
  
  <p>I'm missing something.</p>