UsbCamera.Core 0.0.3

dotnet add package UsbCamera.Core --version 0.0.3
                    
NuGet\Install-Package UsbCamera.Core -Version 0.0.3
                    
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="UsbCamera.Core" Version="0.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="UsbCamera.Core" Version="0.0.3" />
                    
Directory.Packages.props
<PackageReference Include="UsbCamera.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 UsbCamera.Core --version 0.0.3
                    
#r "nuget: UsbCamera.Core, 0.0.3"
                    
#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 UsbCamera.Core@0.0.3
                    
#: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=UsbCamera.Core&version=0.0.3
                    
Install as a Cake Addin
#tool nuget:?package=UsbCamera.Core&version=0.0.3
                    
Install as a Cake Tool

UsbCamera

Windows USB camera capture library using DirectShow, with a framework-agnostic core and adapters for WPF and WinForms.

What’s included

  • Core library: UsbCamera (multi-targets net472 and net6.0-windows7.0)
  • WPF adapter: UsbCamera.Wpf (helper extensions for BitmapSource)
  • WinForms adapter: UsbCamera.WinForms (helper extensions for System.Drawing.Bitmap)
  • Samples: WinForms and WPF demo apps
  • CI/CD: Windows builds via MSBuild, tag-triggered GitHub Releases, optional NuGet publish

Install

NuGet packages (published on tag releases):

  • UsbCamera — core
  • UsbCamera.Wpf — WPF helpers
  • UsbCamera.WinForms — WinForms helpers

Quick start (WinForms)

using UsbCamera;

// enumerate devices
var devices = UsbCamera.FindDevices();
if (devices.Length == 0) return;

var index = 0;
var formats = UsbCamera.GetVideoFormat(index);
var format = formats[0];

var cam = new UsbCamera(index, format);
this.FormClosing += (s, e) => cam.Release();

// preview into a WinForms control
cam.SetPreviewControl(pictureBox1.Handle, pictureBox1.ClientSize);
pictureBox1.Resize += (s, e) => cam.SetPreviewSize(pictureBox1.ClientSize);

cam.Start();
var bmp = cam.GetBitmap(); // System.Drawing.Bitmap

Quick start (WPF)

Use the WPF sample, or host a PictureBox via WindowsFormsHost for light preview, or convert frames with the UsbCamera.Wpf adapter to BitmapSource.

Packages and Releases

  • CI builds Debug/Release with MSBuild on Windows.
  • Tag vX.Y.Z to trigger Release workflow:
    • Builds the solution
    • Packs NuGet for UsbCamera, UsbCamera.Wpf, UsbCamera.WinForms
    • Attaches .nupkg/.snupkg files and a zipped core bin\Release to the GitHub Release
    • Optional: pushes to NuGet when NUGET_API_KEY is configured

Notes

  • The legacy single-file “drop-in” guidance was replaced by SDK-style projects and NuGet packages.
  • Some advanced features (still image capture, grayscale Y8/Y16 pipelines) are supported in the core but may require adapter-specific handling.

Samples

See samples/UsbCameraForms and samples/UsbCameraWpf for end-to-end usage.

Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed.  net9.0-windows was computed.  net10.0-windows was computed. 
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on UsbCamera.Core:

Package Downloads
UsbCamera.Wpf

WPF extensions for UsbCamera library. Provides VideoFrame to BitmapSource conversion.

UsbCamera.WinForms

Windows Forms extensions for UsbCamera library. Provides VideoFrame to Bitmap conversion.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.3 139 11/29/2025