How can i free hbitmap
问题 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 . IntPtr GetFrame(int Width,int Height,int nFrame) { width= Width; height = Height; HBITMAP hb; m_piHelper->GetBmp(width,height,nFrame,&hb); return IntPtr(hb); } 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 Thank you, 回答1: I