DDCSharp.Core 0.1.4

dotnet add package DDCSharp.Core --version 0.1.4
                    
NuGet\Install-Package DDCSharp.Core -Version 0.1.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DDCSharp.Core" Version="0.1.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DDCSharp.Core" Version="0.1.4" />
                    
Directory.Packages.props
<PackageReference Include="DDCSharp.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DDCSharp.Core --version 0.1.4
                    
#r "nuget: DDCSharp.Core, 0.1.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DDCSharp.Core@0.1.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DDCSharp.Core&version=0.1.4
                    
Install as a Cake Addin
#tool nuget:?package=DDCSharp.Core&version=0.1.4
                    
Install as a Cake Tool

DDCSharp

A .NET library for controlling displays via DDC/CI, including brightness, contrast, input source, and other display settings through a simple API

Lightweight C# (.NET 8) library for enumerating physical monitors and performing DDC/CI (MCCS VCP) VCP feature reads / writes (e.g. brightness, input source) with an extensible provider model.

Projects

  • DDCSharp.Core – Provider & transport abstractions plus capability / VCP feature models.
  • DDCSharp.Windows – Windows implementation using dxva2.dll (Win32 APIs) to enumerate and control monitors.

NuGet Packages

Package NuGet Description
DDCSharp.Core NuGet Core abstractions + capability models
DDCSharp.Windows NuGet Windows provider implementation

Install via Package Manager:

PM> Install-Package DDCSharp.Core
PM> Install-Package DDCSharp.Windows

Or with dotnet CLI:

dotnet add package DDCSharp.Core
dotnet add package DDCSharp.Windows

Key Concepts

  • IDisplay – Abstraction of a physical monitor (read / write VCP features, refresh capabilities).
  • IDisplayProvider – Produces IDisplay instances (platform / virtual). Multiple providers can be registered.
  • DisplayService – Thread‑safe static registry to add / clear providers and obtain all displays.
  • Capabilities Parsing – Windows provider fetches the MCCS capability string, extracts sections (type, model, mccs_ver, vcp) and builds a list of Capability entries (feature + supported values list if present).

Supported (subset) Features

Brightness, Contrast, Input Source, Sharpness, Color Gains, Color Presets, Power Mode, Speaker Volume, Audio Mute, Orientation, Frequencies, Panel/Tech info, Usage Time, etc. (See VCPFeature enum for details.)

Quick Start (Windows)

using DDCSharp.Core;
using DDCSharp.Core.Abstractions;
using DDCSharp.Core.Capabilities;
using DDCSharp.Windows;

// Register the Windows provider once at startup
WindowsDisplayProvider.Register();

// Enumerate displays
foreach (var display in DisplayService.GetDisplays())
{
    Console.WriteLine($"Description: {display.Description}  Model: {display.Model}  MCCS: {display.MCCSVersion}");

    // Read brightness
    if (display.TryGetVcpFeature(VCPFeature.Brightness, out var type, out var current, out var max))
    {
        Console.WriteLine($"Brightness: {current}/{max}");
    }

    // Set brightness (0..max range – caller responsibility)
    display.TrySetBrightness(50);

    // List supported input sources
    var sources = display.GetSupportedInputSources();
    Console.WriteLine("Inputs: " + string.Join(", ", sources));

    // Change input if supported
    if (sources.Contains(InputSource.HDMI1))
    {
        display.TrySetInputSource(InputSource.HDMI1);
    }
}

Thread Safety

  • Provider registration is synchronized (DisplayService).
  • Each WindowsDisplay synchronizes native calls per display instance.

Extending (Custom Provider)

Implement IDisplayProvider and produce objects implementing IDisplay.

public sealed class MyProvider : IDisplayProvider
{
    public IEnumerable<IDisplay> GetDisplays()
    {
        // Open native handles, wrap them in your IDisplay implementation
        yield break;
    }
}

DisplayService.RegisterProvider(new MyProvider());

IDisplay must expose metadata, capabilities, attempt VCP gets/sets, and dispose native resources.

Capability Refresh

Call display.RefreshCapabilities() to re-fetch the MCCS capability string (e.g., after OSD adjustments or hot‑plug events).

Error Handling

  • Provider enumeration exceptions are swallowed so one provider cannot block others.
  • VCP read/write methods return bool indicating success.

Platform Notes

  • Windows: uses dxva2.dll (GetVCPFeatureAndVCPFeatureReply, SetVCPFeature, capability string APIs) + EnumDisplayMonitors.
  • Other platforms: supply a custom provider (e.g., DDC via I2C, USB HID, network bridge, mock/testing provider).

Disclaimer

Writing values to unsupported VCP features may fail silently. Some monitors expose incomplete or vendor-specific capability strings. Use at your own risk.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DDCSharp.Core:

Package Downloads
DDCSharp.Windows

Windows implementation for DDCSharp providing monitor enumeration and VCP command transport.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.4 190 10/6/2025