System.Windows.Interop.D3DImage.CopyBackBuffer C# (CSharp) Method

CopyBackBuffer() private method

private CopyBackBuffer ( ) : BitmapSource
return BitmapSource
        protected internal virtual BitmapSource CopyBackBuffer()
        {
            SecurityHelper.DemandUnmanagedCode();
            
            BitmapSource copy = null;
            
            if (_pInteropDeviceBitmap != null)
            {
                BitmapSourceSafeMILHandle pIWICBitmapSource;
                
                if (HRESULT.Succeeded(UnsafeNativeMethods.InteropDeviceBitmap.GetAsSoftwareBitmap(
                    _pInteropDeviceBitmap,
                    out pIWICBitmapSource
                    )))
                {
                    // CachedBitmap will AddRef the bitmap
                    copy = new CachedBitmap(pIWICBitmapSource);
                }
            }

            return copy;         
        }