Documentation Portal      

What are you looking for?

Reading a Bar Code of Known Location

Functional Guide | Reference: SetKnownLocation, SetCenterXY, SetReadingSize

//////////////////////////////////////////////////////////
// This code snippet shows how to specify the bar code //
// position and perform the bar code reading. //
//////////////////////////////////////////////////////////
// Image constructor
EImageBW8 srcImage;
// Bar code reader constructor
EBarCode reader;
// String for the decoded bar code
std::string result;
// ...
// Disable automatic bar code detection
reader.SetKnownLocation(TRUE);
// Set the bar code position
reader.SetCenterXY(450.0f, 400.0f)
reader.SetSize(250.0f, 110.0f);
reader.SetReadingSize(1.15f, 0.5f);
// Read the bar code at the specified location
result = reader.Read(&srcImage);
'//////////////////////////////////////////////////////////
'// This code snippet shows how to specify the bar code //
'// position and perform the bar code reading. //
'//////////////////////////////////////////////////////////
' Image constructor
Dim srcImage As New EImageBW8
' Bar code reader constructor
Dim reader As New EBarCode
' String for the decoded bar code
Dim result As String
' ...
' Disable automatic bar code detection
reader.KnownLocation = True
' Set the bar code position
reader.SetCenterXY 450#, 400#
reader.SetSize 250#, 110#
reader.SetReadingSize 1.15, 0.5
' Read the bar code at the specified location
result = reader.Read(srcImage)
//////////////////////////////////////////////////////////
// This code snippet shows how to specify the bar code //
// position and perform the bar code reading. //
//////////////////////////////////////////////////////////
// Image constructor
EImageBW8 srcImage= new EImageBW8();
// Bar code reader constructor
EBarCode reader= new EBarCode();
// String for the decoded bar code
string result;
// ...
// Disable automatic bar code detection
reader.KnownLocation = true;
// Set the bar code position
reader.SetCenterXY(450.0f, 400.0f);
reader.SetSize(250.0f, 110.0f);
reader.SetReadingSize(1.15f, 0.5f);
// Read the bar code at the specified location
result = reader.Read(srcImage);

Which API shall we display?

© 2019 EURESYS s.a.  -  About Documentation  -  Open Source Licenses  -  Open eVision 2.10.0.1121