ByteScout Barcode Reader SDK - C++ (Managed) - Read Barcode From 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++ (Managed) – Read Barcode From Image

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Reader SDK – C++ (Managed) – Read Barcode From Image

How to read barcode from image in C++ (Managed) with ByteScout BarCode Reader SDK

Tutorial on how to read barcode from image in C++ (Managed)

Sample source code below will show you how to cope with a difficult task like read barcode from image in C++ (Managed). ByteScout BarCode Reader SDK: the SDK for barcode decoding. Can read all popular types from Code 128, GS1, UPC and Code 39 to QR Code, Datamatrix, PDF417. Images, pdf, TIF images and live web camera are supported as input. Designed to handle documents with noise and defects. Includes optional splitter and merger for pdf and tiff based on barcodes. Batch mode is optimized for high performance with multiple threads. Decoded values can be exported to XML, JSON, CSV or into custom data format. It can read barcode from image in C++ (Managed).

C++ (Managed) code samples for C++ (Managed) developers help to speed up coding of your application when using ByteScout BarCode Reader SDK. In order to implement the functionality, you should copy and paste this code for C++ (Managed) below into your code editor with your app, compile and run your application. Detailed tutorials and documentation are available along with installed ByteScout BarCode Reader SDK if you’d like to dive deeper into the topic and the details of the API.

Download free trial version of ByteScout BarCode Reader SDK from our website with this and other source code samples for C++ (Managed).

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

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

AssemblyInfo.cpp
      
#include "stdafx.h" using namespace System; using namespace System::Reflection; using namespace System::Runtime::CompilerServices; using namespace System::Runtime::InteropServices; using namespace System::Security::Permissions; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly:AssemblyTitleAttribute("HelloWorld")]; [assembly:AssemblyDescriptionAttribute("")]; [assembly:AssemblyConfigurationAttribute("")]; [assembly:AssemblyCompanyAttribute("")]; [assembly:AssemblyProductAttribute("HelloWorld")]; [assembly:AssemblyCopyrightAttribute("Copyright (c) 2010")]; [assembly:AssemblyTrademarkAttribute("")]; [assembly:AssemblyCultureAttribute("")]; // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the value or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly:AssemblyVersionAttribute("1.0.*")]; [assembly:ComVisible(false)]; [assembly:CLSCompliantAttribute(true)]; [assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];

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

CommonExample.cpp
      
#include "stdafx.h" using namespace System; using namespace System::IO; using namespace System::Drawing; using namespace Bytescout::BarCodeReader; int main(array<System::String ^> ^args) { String ^path = "BarcodePhoto.jpg"; Console::WriteLine("Reading barcode(s) from image " + Path::GetFullPath(path)); Reader ^bc = gcnew Reader(); // Set to find all barcode types bc->BarcodeTypesToFind->All = true; // But we recommend to use specific barcode types to avoid false positives, e.g.: // bc->BarcodeTypesToFind->QRCOde = true; // bc->BarcodeTypesToFind->Code39 = true; // Decode barcodes bc->ReadFrom(path); for (int i=0; i < bc->FoundCount; i++) { Console::WriteLine("Found barcode with type: " + bc->GetFoundBarcodeType(i).ToString() + " and value: " + bc->GetFoundBarcodeValue(i)); } Console::WriteLine("Press any key to exit.."); Console::ReadKey(); return 0; }

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

resource.h
      
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by app.rc

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

stdafx.cpp
      
// stdafx.cpp : source file that includes just the standard includes // HelloWorld.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #include "stdafx.h"

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

stdafx.h
      
// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once // TODO: reference additional headers your program requires here

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