title: Are Bitmap.LockBits and Graphics.FromImage combinable in C#
body: <p>Can you combine the methods of Bitmap.LockBits and Graphics.FromImage, or in other words if I have a bitmap "bmp" and I want to edit the bitmap with a Graphics-object g, are the changes visible in the byte-array of the BitmapData.Scan0:</p>
  
  <pre><code>Bitmap bmp = new Bitmap(200,200);
  Graphics g = Graphics.FromImage(bmp);
  bmp.LockBits(new Rectangle(0,0,200,200),
      ImageLockMode.ReadOnly,PixelFormat.Format32bppArgb);
  byte* pixelData = (byte*) (void*) bmd.Scan0;
  g.FillRectangle(Brushes.Red,new Rectangle(0,0,50,50));
  </code></pre>
  
  <p>can I see the changes in PixelData after I filled a red rectangle?</p>