ByteScout Barcode Reader SDK - C# - Filters to downscale Image - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Barcode Reader SDK – C# – Filters to downscale Image

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – C# – Filters to downscale Image

filters to downscale image in C# using ByteScout BarCode Reader SDK

filters to downscale image in C#

These source code samples are assembled by their programming language and functions they use. ByteScout BarCode Reader SDK was made to help with filters to downscale image in C#. ByteScout BarCode Reader SDK is the SDK for reading of barcodes from PDF, images and live camera or video. Almost every common type like Code 39, Code 128, GS1, UPC, QR Code, Datamatrix, PDF417 and many others are supported. Supports noisy and defective images and docs. Includes optional documents splitter and merger for pdf and tiff based on found barcodess. Batch mode is supported for superior performance using multiple threads. Decoded values are easily exported to JSON, CSV, XML and to custom format.

C# code snippet like this for ByteScout BarCode Reader SDK works best when you need to quickly implement filters to downscale image in your C# application. If you want to implement this functionality, you should copy and paste code below into your app using code editor. Then compile and run your application. Enjoy writing a code with ready-to-use sample C# codes to implement filters to downscale image using ByteScout BarCode Reader SDK.

On our website you may get trial version of ByteScout BarCode Reader SDK for free. Source code samples are included to help you with your C# application.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

BarcodesFromPDF.NETCore.csproj
      
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp2.0</TargetFramework> <EnableDefaultCompileItems>false</EnableDefaultCompileItems> <GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute> <GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute> <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute> <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute> <GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute> <GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute> <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute> <GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute> <GenerateAssemblyTrademarkAttribute>false</GenerateAssemblyTrademarkAttribute> <GenerateAssemblyCultureAttribute>false</GenerateAssemblyCultureAttribute> <GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute> </PropertyGroup> <ItemGroup> <Compile Include="Program.cs" /> <None Include="example.pdf"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> <ItemGroup> <PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" /> </ItemGroup> <ItemGroup> <Reference Include="Bytescout.BarCodeReader"> <SpecificVersion>False</SpecificVersion> <HintPath>c:\Program Files\Bytescout BarCode Reader SDK\netcoreapp2.0\Bytescout.BarCodeReader.dll</HintPath> </Reference> </ItemGroup> </Project>

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

BarcodesFromPDF.VS2010.csproj
      
<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProductVersion> </ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{152D91ED-9533-49A6-9433-0037FA578D4F}</ProjectGuid> <OutputType>Exe</OutputType> <RootNamespace>BarcodesFromPDF</RootNamespace> <AssemblyName>BarcodesFromPDF</AssemblyName> <OldToolsVersion>3.5</OldToolsVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="Bytescout.BarCodeReader, Version=8.20.0.1340, Culture=neutral, PublicKeyToken=f7dd1bd9d40a50eb, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>C:\Program Files\Bytescout BarCode Reader SDK\net4.00\Bytescout.BarCodeReader.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Drawing" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="Program.cs" /> </ItemGroup> <ItemGroup> <None Include="example.pdf"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project>

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Program.cs
      
using System; using System.Diagnostics; using Bytescout.BarCodeReader; namespace BarcodesFromPDF { class Program { static void Main() { using (var reader_default = new Reader("demo","demo")) { // Limit search to 1-dimensional barcodes only (exclude 2D barcodes to speed up the processing). // Change to barcodeReader.BarcodeTypesToFind.SetAll() to scan for all supported 1D and 2D barcode types // or select specific type, e.g. barcodeReader.BarcodeTypesToFind.PDF417 = True reader_default.BarcodeTypesToFind.All1D = true; // Using StopWatch to track operation time var sw_reader_default = new Stopwatch(); sw_reader_default.Start(); Console.WriteLine("Reading barcodes from PDF document with default resolution ...\n"); FoundBarcode[] barcodes = reader_default.ReadFrom("example.pdf"); foreach (FoundBarcode barcode in barcodes) { Console.WriteLine("Found barcode with type '{0}' and value '{1}' on page {2} at {3}", barcode.Type, barcode.Value, barcode.Page, barcode.Rect); } sw_reader_default.Stop(); Console.WriteLine("\nELAPSED TIME (in milliseconds): " + sw_reader_default.ElapsedMilliseconds); } Console.WriteLine("\n===============\n"); using (var reader_with_filter = new Reader("demo", "demo")) { // Limit search to 1-dimensional barcodes only (exclude 2D barcodes to speed up the processing). // Change to barcodeReader.BarcodeTypesToFind.SetAll() to scan for all supported 1D and 2D barcode types // or select specific type, e.g. barcodeReader.BarcodeTypesToFind.PDF417 = True reader_with_filter.BarcodeTypesToFind.All1D = true; // Setting PDF rendering resolution to 150 reader_with_filter.PDFRenderingResolution = 150; // Using StopWatch to track operation time var sw_reader_optimized = new Stopwatch(); sw_reader_optimized.Start(); Console.WriteLine("Reading barcodes from PDF document with filter set for resolution ...\n"); FoundBarcode[] barcodes = reader_with_filter.ReadFrom("example.pdf"); foreach (FoundBarcode barcode in barcodes) { Console.WriteLine("Found barcode with type '{0}' and value '{1}' on page {2} at {3}", barcode.Type, barcode.Value, barcode.Page, barcode.Rect); } sw_reader_optimized.Stop(); Console.WriteLine("\nELAPSED TIME (in milliseconds): " + sw_reader_optimized.ElapsedMilliseconds); } Console.WriteLine(); Console.WriteLine("Press any key to continue."); Console.ReadKey(); } } }

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout BarCode Reader SDK Home Page

Explore ByteScout BarCode Reader SDK Documentation

Explore Samples

Sign Up for ByteScout BarCode Reader SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next