In Dynamsoft Barcode Reader SDK, there is a fancy webcam barcode sample called BarcodeReaderDemo that supports reading barcodes from disk files, TWAIN-compatible hardware scanners, and USB webcams. However, one thing you have to know is the functionality of acquiring images from peripheral devices relies on Dynamic .NET TWAIN, which is also charged. Fortunately, the image viewer library and image codecs library are free to use. In this article, I will share how to remove the scanner module from the project and use DirectShow for webcam control.Read more
C# is the preferred programming language for developing Windows applications. However, Microsoft only provides .NET camera APIs for UWP applications. If you plan to write a classic Windows desktop application using a webcam, it will be complicated to create a C/C++ wrapper for DirectShow Win32 APIs. Dynamic .NET TWAIN is an SDK that supports programming for both scanner and webcam. In this article, you will see how easy to build a webcam application with the SDK. In addition, you can learn how to detect and recognize barcodes from the video stream with Dynamsoft Barcode Reader SDK.
Previously I shared how to use Touchless, which wraps the win32 APIs of DirectShow, to control webcam in C#. In this article, let’s take a further step to see how to use the more complicated DirectShow.NET APIs to capture the video stream and read barcode from preview frames on Windows.
If you have a USB camera, how can you build a simple C# camera application on Windows 10? There are three options: WIA (Windows Imaging Acquisition), DirectShow and MediaCapture. After trying some sample code that downloaded from CodeProject and GitHub, I got the conclusion: 1. WIA is not good because it does not support my webcam. 2. DirectShow can work well, but there is no C# API provided by Microsoft. You need to create a wrapper for C++ API. 3. MediaCapture class that designed for UWP apps provides C# APIs which provide low-level control over the capture pipeline and enable advanced capture scenarios. In this article, I want to share how to create a simple C# webcam app in which I can handle every preview frame myself.