NickeManarin/ScreenToGif · error · GraphicsConfigurationException

The Desktop Duplication API is not supported on this screen.

Error message

The Desktop Duplication API is not supported on this screen.

What it means

Thrown by DirectImageCapture when DuplicateOutput raises a SharpDXException with the InvalidCall DXGI result code. Unlike the Unsupported case (which means the whole computer lacks DDA), InvalidCall typically means the specific output/device combination cannot be duplicated — often a multi-monitor or device-output mismatch issue.

Source

Thrown at ScreenToGif/Capture/DirectImageCapture.cs:198

            //Get the Output1 based on the current capture region position.
            using (var output1 = GetOutput(factory))
            {
                try
                {
                    //Make sure to run with the integrated graphics adapter if using a Microsoft hybrid system. https://stackoverflow.com/a/54196789/1735672
                    DuplicatedOutput = output1.DuplicateOutput(Device);
                }
                catch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.NotCurrentlyAvailable)
                {
                    throw new Exception("Too many applications using the Desktop Duplication API. Please close one of the applications and try again.", e);
                }
                catch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.Unsupported)
                {
                    throw new GraphicsConfigurationException("The Desktop Duplication API is not supported on this computer.", e);
                }
                catch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.InvalidCall)
                {
                    throw new GraphicsConfigurationException("The Desktop Duplication API is not supported on this screen.", e);
                }
                catch (SharpDXException e) when (e.Descriptor.NativeApiCode == "E_INVALIDARG")
                {
                    throw new GraphicsConfigurationException("Looks like that the Desktop Duplication API is not supported on this screen.", e);
                }
            }
        }
    }

    /// <summary>
    /// Get the correct Output1 based on region to be captured.
    /// </summary>
    private Output1 GetOutput(Factory1 factory)
    {
        try
        {
            //Gets the output with the bigger area being intersected.
            var output = factory.Adapters1.SelectMany(s => s.Outputs).FirstOrDefault(f => f.Description.DeviceName == DeviceName) ??

View on GitHub (pinned to a4d0a67c21)

Solutions

  1. Ensure the Device and Output1 are created from the same adapter — enumerate adapters and match the output's adapter.
  2. Re-enumerate outputs right before calling DuplicateOutput in case the monitor configuration changed.
  3. On hybrid GPU systems, force the application to run on the integrated GPU (see the StackOverflow link in the source comment).
  4. Handle GraphicsConfigurationException and fall back to BitBlt capture for the problematic output.

Example fix

// before
catch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.InvalidCall)
{
    throw new GraphicsConfigurationException("The Desktop Duplication API is not supported on this screen.", e);
}

// after: re-enumerate and match adapter before retrying
catch (SharpDXException e) when (e.Descriptor == SharpDX.DXGI.ResultCode.InvalidCall)
{
    Device = new SharpDX.Direct3D11.Device(output1.Adapter); // match adapter
    DuplicatedOutput = output1.DuplicateOutput(Device);
}
Defensive patterns

Strategy: validation

Validate before calling

// Ensure Device and Output1 are from the same adapter
var output = factory.Adapters1
    .SelectMany(a => a.Outputs)
    .FirstOrDefault(o => o.Description.DeviceName == DeviceName);
if (output == null || output.Adapter != Device.Adapter)
    Device = new SharpDX.Direct3D11.Device(output.Adapter);

Type guard

static bool AreDeviceAndOutputSameAdapter(Device device, Output1 output)
{
    return device.Adapter.Description.Description == output.Adapter.Description.Description;
}

Try / catch

try
{
    DuplicatedOutput = output1.DuplicateOutput(Device);
}
catch (GraphicsConfigurationException ex) when (ex.Message.Contains("not supported on this screen"))
{
    Device = new SharpDX.Direct3D11.Device(output1.Adapter);
    DuplicatedOutput = output1.DuplicateOutput(Device);
}

Prevention

When it happens

Trigger: DuplicateOutput is called with a Device and Output1 that belong to different adapters, or the output is not the primary desktop output. Common with multi-GPU systems (integrated + discrete) where the device was created on one adapter but the output is on another.

Common situations: Laptop with hybrid graphics (Intel iGPU + NVIDIA dGPU) where ScreenToGif's DirectX device was created on adapter A but the target monitor is on adapter B. Monitor was disconnected or reconnected between enumeration and duplication. The selected output does not intersect the capture region.

Related errors


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