NickeManarin/ScreenToGif · error · Exception

Windows 8 or newer is required for capturing the screen usin

Error message

Windows 8 or newer is required for capturing the screen using the Desktop Duplication API.

What it means

Thrown by PrepareCapture when the user has enabled 'Use desktop duplication' (UserSettings.All.UseDesktopDuplication) but OperationalSystemHelper.IsWin8OrHigher() returns false. IsWin8OrHigher checks Environment.OSVersion.Platform == Win32NT && Version >= 6.2.9200. The Desktop Duplication API (DXGI IDXGIOutputDuplication) only exists on Windows 8 and later, so older OSes cannot use that backend and must fall back to BitBlt capture.

Source

Thrown at ScreenToGif/Windows/Recorder.xaml.cs:1529

    }

    private async Task PrepareCapture(bool isNew = true)
    {
        if (isNew && Capture != null)
        {
            await Capture.DisposeAsync();
            Capture = null;
        }

        //If the capture helper was initialized already, ignore this.
        if (Capture != null)
            return;

        if (UserSettings.All.UseDesktopDuplication)
        {
            //Check if Windows 8 or newer.
            if (!OperationalSystemHelper.IsWin8OrHigher())
                throw new Exception(LocalizationHelper.Get("S.Recorder.Warning.Windows8"));

            Capture = GetDirectCapture();
            Capture.DeviceName = _viewModel.CurrentMonitor.Name;
            _viewModel.IsDirectMode = true;
        }
        else
        {
            //Capture with BitBlt.
            Capture = UserSettings.All.UseMemoryCache ? new CachedCapture() : new ImageCapture();
            _viewModel.IsDirectMode = true;
        }

        Capture.OnError += exception =>
        {
            Dispatcher?.Invoke(() =>
            {
                //Pause the recording and show the error.
                Pause();

View on GitHub (pinned to a4d0a67c21)

Solutions

  1. Turn off 'Use desktop duplication' in Settings > Extras so PrepareCapture uses the BitBlt path (ImageCapture/CachedCapture), which works on Windows 7.
  2. Upgrade the OS to Windows 8/10/11 where Desktop Duplication is available.
  3. If the OS really is Win8+ but reports wrong, check the app.manifest <compatibility> section declares Windows 8/10 GUIDs so Environment.OSVersion reports correctly.
  4. Catch the exception in PrepareCapture's caller and automatically disable UseDesktopDuplication + retry with BitBlt instead of surfacing a hard failure.

Example fix

// before
if (UserSettings.All.UseDesktopDuplication)
{
    if (!OperationalSystemHelper.IsWin8OrHigher())
        throw new Exception(LocalizationHelper.Get("S.Recorder.Warning.Windows8"));
    Capture = GetDirectCapture();
}

// after: auto-fallback to BitBlt with a logged warning instead of throwing
if (UserSettings.All.UseDesktopDuplication)
{
    if (!OperationalSystemHelper.IsWin8OrHigher())
    {
        LogWriter.Log("Desktop Duplication requires Windows 8+. Falling back to BitBlt capture.");
        UserSettings.All.UseDesktopDuplication = false;
    }
    else
    {
        Capture = GetDirectCapture();
        Capture.DeviceName = _viewModel.CurrentMonitor.Name;
        _viewModel.IsDirectMode = true;
        return;
    }
}

if (Capture == null)
{
    Capture = UserSettings.All.UseMemoryCache ? new CachedCapture() : new ImageCapture();
    _viewModel.IsDirectMode = true;
}
Defensive patterns

Strategy: validation

Validate before calling

// Validate OS support for Desktop Duplication BEFORE starting the recorder.
if (UserSettings.All.UseDesktopDuplication && !OperationalSystemHelper.IsWin8OrHigher())
{
    // Auto-downgrade to BitBlt instead of letting PrepareCapture throw.
    UserSettings.All.UseDesktopDuplication = false;
    LogWriter.Log("Desktop Duplication unsupported on this OS; switched to BitBlt.");
}

Type guard

// Type/narrowing guard for the capture backend selection.
static bool SupportsDesktopDuplication() =>
    OperationalSystemHelper.IsWin8OrHigher();

if (UserSettings.All.UseDesktopDuplication && !SupportsDesktopDuplication())
    UserSettings.All.UseDesktopDuplication = false;

Try / catch

try
{
    await PrepareCapture();
}
catch (Exception e) when (e.Message == LocalizationHelper.Get("S.Recorder.Warning.Windows8"))
{
    // Auto-recover: disable Desktop Duplication and retry on BitBlt.
    UserSettings.All.UseDesktopDuplication = false;
    LogWriter.Log(e, "Desktop Duplication unavailable; retrying with BitBlt.");
    await PrepareCapture();
}

Prevention

When it happens

Trigger: UserSettings.All.UseDesktopDuplication == true and the process is running on Windows 7 (or an OS reporting a version below 6.2.9200 via Environment.OSVersion). PrepareCapture is called when starting a recording, so the throw fires at the moment the recorder tries to initialize the DXGI direct-capture backend.

Common situations: Running ScreenToGif on Windows 7 (the last version without IDXGIOutputDuplication) with the Desktop Duplication option enabled; running under an app-compatibility shim or manifest that causes Environment.OSVersion to report a downgraded version; a compatibility layer (Wine) reporting a non-Win32NT platform; the setting was toggled on a newer machine and synced/carried to an older one.

Related errors


AI-assisted analysis of NickeManarin/ScreenToGif@a4d0a67c21 (2026-08-13). Data as JSON: /api/errors/6c4f51213928d73f. Report an issue: GitHub.