title: Clear drawn graphics on a picturebox without clearing original picture
body: <p>In a geographical software written in C#, a <code>PictureBox</code> is used to show  GIS map that is saved as a <code>png</code> file in a temporary directory. There is some geometric shapes we need to be drawn on map. We used <code>System.Drawing</code> methods to perform this action. </p>
  
  <p>Sometimes we need to change some properties these shapes or delete them, we need to remove the shapes without making beneath them black. Drawing them again with <code>Color.Transparent</code> obviously doesn't work, using <code>Graphics#Clear(Color.Transparent)</code> doesn't work too for the same reason.</p>
  
  <p>We even tried using another picture box with transparent background that is used only for purpose of drawing shapes on; so that when we use <code>Graphics#Clear(Color.Transparent)</code> map container remains untouched. Sounded like a perfect idea at first, but because i don't know how and why it makes map container <code>PictureBox</code> invisible and map viewer panel is totally black, this idea failed too.</p>
  
  <pre><code>MapViewerForm
      |-- Toolbar
      |-- StatusBar
      |-- MapViewer Panel (Provides scrollbars)
              |-- MapContainer Pictutebox
              |-- Shapes drawing canvas PictureBbox (The same size and location as map container, only difference is z-order)
  </code></pre>
  
  <p>I prefer to use the two <code>PictureBox</code>es and making 'layers' idea, i think it's less unprofessional than the other idea (I am actually a java developer and this is a C# project!), I think there should be something like java's <code>JLayeredPane</code> in C# to adjust z-order of those two picture boxes and omit black screen bug, But if there is a solution to draw shapes on map container itself and then clear them without losing portions of maps lying behind them i'd appreciate that answer too.</p>
  
  <p>P.S: If we load map picture from file and store it in a <code>Bitmap</code> or <code>Image</code> private field and when we need to clear drawings, load image from that field with a piece of code like <code>picMapArea.Image = MapViewer.getInstance().getMapImage();</code> (Note: <code>MapViewer</code> is a singleton class) the painted shapes will be gone but it's obviously not anything like a "good idea" because of poor performance and lagging. </p>
  
  <p>Thanks in advance.</p>