UsbCamera.Core
0.0.3
dotnet add package UsbCamera.Core --version 0.0.3
NuGet\Install-Package UsbCamera.Core -Version 0.0.3
<PackageReference Include="UsbCamera.Core" Version="0.0.3" />
<PackageVersion Include="UsbCamera.Core" Version="0.0.3" />
<PackageReference Include="UsbCamera.Core" />
paket add UsbCamera.Core --version 0.0.3
#r "nuget: UsbCamera.Core, 0.0.3"
#:package UsbCamera.Core@0.0.3
#addin nuget:?package=UsbCamera.Core&version=0.0.3
#tool nuget:?package=UsbCamera.Core&version=0.0.3
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-targetsnet472andnet6.0-windows7.0) - WPF adapter:
UsbCamera.Wpf(helper extensions forBitmapSource) - WinForms adapter:
UsbCamera.WinForms(helper extensions forSystem.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— coreUsbCamera.Wpf— WPF helpersUsbCamera.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.Zto trigger Release workflow:- Builds the solution
- Packs NuGet for
UsbCamera,UsbCamera.Wpf,UsbCamera.WinForms - Attaches
.nupkg/.snupkgfiles and a zipped corebin\Releaseto the GitHub Release - Optional: pushes to NuGet when
NUGET_API_KEYis 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 | Versions 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. |
-
.NETFramework 4.7.2
- No dependencies.
-
net6.0-windows7.0
- System.Drawing.Common (>= 7.0.0)
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 |