public virtual void DestroyBitmap() { // Destroy the bitmap. IntPtr hBitmap = this.HBitmap; if (hBitmap != IntPtr.Zero) { Win32.DeleteObject(hBitmap); this.HBitmap = IntPtr.Zero; } }