DDCSharp.Core
0.1.4
dotnet add package DDCSharp.Core --version 0.1.4
NuGet\Install-Package DDCSharp.Core -Version 0.1.4
<PackageReference Include="DDCSharp.Core" Version="0.1.4" />
<PackageVersion Include="DDCSharp.Core" Version="0.1.4" />
<PackageReference Include="DDCSharp.Core" />
paket add DDCSharp.Core --version 0.1.4
#r "nuget: DDCSharp.Core, 0.1.4"
#:package DDCSharp.Core@0.1.4
#addin nuget:?package=DDCSharp.Core&version=0.1.4
#tool nuget:?package=DDCSharp.Core&version=0.1.4
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 usingdxva2.dll(Win32 APIs) to enumerate and control monitors.
NuGet Packages
| Package | NuGet | Description |
|---|---|---|
| DDCSharp.Core | Core abstractions + capability models | |
| DDCSharp.Windows | 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– ProducesIDisplayinstances (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 ofCapabilityentries (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
WindowsDisplaysynchronizes 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
boolindicating 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 | Versions 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. |
-
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 |