# Reading a Bar Code Following a Given Symbology Code Snippet

This code snippet shows how to enable a given symbology, enable the checksum verification, perform the bar code detection and retrieve the decoded string.

## C++

```cpp
#include <eVision/EasyBarCode/EasyBarCode1/EBarCode.h>
```

```cpp
using namespace eVision;
// Image constructor
EImageBW8 srcImage;
// Bar code reader constructor
EBarCode reader;
// String for the decoded bar code
std::string result;
// ...
// Disable all standard symbologies
reader.SetStandardSymbologies(0);
// Enable the Code32 symbology only
reader.SetAdditionalSymbologies(ESymbologies_Code32);
// Enable checksum verification
reader.SetVerifyChecksum(true);
// Detect all possible meanings of the bar code
reader.Detect(&srcImage);
// Retrieve the number of symbologies for
// which the decoding process was successful
int numDecoded = reader.GetNumDecodedSymbologies();
if (numDecoded > 0)
{
  // Decode the bar code according to the Code32 symbology
  result = reader.Decode(ESymbologies_Code32);
}
```

#### SEE ALSO
[`EBarCode::SetAdditionalSymbologies`](../../../../../doxygen_cpp/classeVision_1_1EBarCode.html#ae38c517fcb9e80b006f29ce5be93051e) [<sub>.NET</sub>](../../../../../doxygen_cs/classeVision_1_1EBarCode.html#a4aa3c08b5e6ac9ceaf07091a98b7f950), [`EBarCode::Detect`](../../../../../doxygen_cpp/classeVision_1_1EBarCode.html#aaf1a7e05ebb86632b81f544bfa247992) [<sub>.NET</sub>](../../../../../doxygen_cs/classeVision_1_1EBarCode.html#ae1d9a27f068d9c30ff2ce35e1ec213b5), [`EBarCode::Decode`](../../../../../doxygen_cpp/classeVision_1_1EBarCode.html#adeb56f5e7de99898dc475ed16d727792) [<sub>.NET</sub>](../../../../../doxygen_cs/classeVision_1_1EBarCode.html#a758a0a1eee676c2c1e778216ac5bdb29)

## C#

```cs
using eVision;
```

```cs
// Image constructor
EImageBW8 srcImage = new EImageBW8();
// Bar code reader constructor
eVision.EBarCode reader = new eVision.EBarCode();
// String for the decoded bar code
string result;
// ...
// Disable all standard symbologies
reader.StandardSymbologies = 0;
// Enable the Code32 symbology only
reader.AdditionalSymbologies = (int)ESymbologies.Code32;
// Enable checksum verification
reader.VerifyChecksum = true;
// Detect all possible meanings of the bar code
reader.Detect(srcImage);
// Retrieve the number of symbologies for
// which the decoding process was successful
uint numDecoded = reader.NumDecodedSymbologies;
if (numDecoded > 0)
{
  // Decode the bar code according to the Code32 symbology
  result = reader.Decode(ESymbologies.Code32);
}
```

#### SEE ALSO
[`EBarCode.AdditionalSymbologies`](../../../../../doxygen_cs/classeVision_1_1EBarCode.html#a4aa3c08b5e6ac9ceaf07091a98b7f950) [<sub>C++</sub>](../../../../../doxygen_cpp/classeVision_1_1EBarCode.html#afb66de6c59e8e897d2748f39014bc8ac), [`EBarCode.Detect`](../../../../../doxygen_cs/classeVision_1_1EBarCode.html#ae1d9a27f068d9c30ff2ce35e1ec213b5) [<sub>C++</sub>](../../../../../doxygen_cpp/classeVision_1_1EBarCode.html#aaf1a7e05ebb86632b81f544bfa247992), [`EBarCode.Decode`](../../../../../doxygen_cs/classeVision_1_1EBarCode.html#a758a0a1eee676c2c1e778216ac5bdb29) [<sub>C++</sub>](../../../../../doxygen_cpp/classeVision_1_1EBarCode.html#adeb56f5e7de99898dc475ed16d727792)

## Python

#### WARNING
This snippet is not available in this language.
