BExplorer.Shell.Interop.ShellThumbnail.GetBitmap C# (CSharp) Method

GetBitmap() private method

private GetBitmap ( System size ) : Bitmap
size System
return System.Drawing.Bitmap
        private Bitmap GetBitmap(System.Windows.Size size)
        {
            IntPtr hBitmap = GetHBitmap(size);

            // return a System.Drawing.Bitmap from the hBitmap
            Bitmap returnValue = null;
            if (hBitmap != IntPtr.Zero)
                returnValue = GetBitmapFromHBitmap(hBitmap);

            // delete HBitmap to avoid memory leaks
            Gdi32.DeleteObject(hBitmap);

            return returnValue;
        }