title: How can i free hbitmap
body: <p>Hello i have the following function which i use afterwards from c# to display a bitmap with "Bitmap.FromHbitmap(IntPtr)" but after a few usages this ends with a memory leak . </p>
  
  <pre><code>IntPtr GetFrame(int Width,int Height,int nFrame)
      {
          width= Width;
          height = Height;
          HBITMAP hb;
          m_piHelper-&gt;GetBmp(width,height,nFrame,&amp;hb);    
          return IntPtr(hb);
      }
  </code></pre>
  
  <p>Probably i should deleteobject somewere but i dont know where i could do that i tried before return but i end up with no image but a gdi error</p>
  
  <p>Thank you,</p>