title: How to return a GDI::Bitmap from a function
body: <p>How can I return a bitmap from a function?
  This code doesn't work: Compiler error</p>
  
  <pre><code> Gdiplus::Bitmap create()
   {
         Gdiplus::Bitmap bitmap(10,10,PixelFormat32bppRGB);
  
         // fill image
         return bitmap;
   }
  </code></pre>
  
  <p>I don't want to return a pointer as then it generate a chance for memory leak. (or if there is way to avoid this chance of memory leak)</p>