title: How to save shapes which I draw on a Panel as binary
body: <p>I have a mini paint program . I want to create a save button which saves the panel details(shapes and everything that is been drawing) as a binary file. I did this:</p>
  
  <pre><code> SaveFileDialog sfd = new SaveFileDialog();
   BinaryFormatter bf = new BinaryFormatter();
   var stream = new BinaryReader(File.Open(sfd.FileName,FileMode.Create));
   bf.Serialize(stream,object);
  </code></pre>
  
  <p>but it has an error which using object is invalid in <code>bf.Serialize</code>. how should I do this?</p>