Showing a Preview

Most scanning software provides the ability to quickly scan a low-resolution preview. This is especially helpful for enabling the user to crop the region to scan. You can support cropping with FlatbedConfiguration or FeederConfiguration’s SelectedScanRegion property, and you can support previews with ImageScanner’s ScanPreviewToStreamAsync method. You can use it as follows:

async Task ShowPreview(string deviceId, Image targetImage) {   // Get the scanner object   ImageScanner scanner = await ImageScanner.FromIdAsync(deviceId);   if (scanner != null &&       scanner.IsScanSourceSupported(ImageScannerScanSource.Flatbed) &&       scanner.IsPreviewSupported(ImageScannerScanSource .Flatbed))   {      ...

Get Universal Windows® Apps with XAML and C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.