# EasyBarCodeRead

| Support            | ![](assets/images/sample_programs/applies_to/cpp.svg) ![](assets/images/sample_programs/applies_to/cs.svg) ![](assets/images/sample_programs/applies_to/qt.svg) ![](assets/images/sample_programs/applies_to/vb.svg) ![](assets/images/sample_programs/applies_to/python.svg)   |
|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Required licenses  | **EasyBarCode**                                                                                                                                                                                                                                                                 |
| Recommended images | Any image from the folder `Sample Images/EasyBarCode`                                                                                                                                                                                                                           |
| Location           | `Text and Code Reading/EasyCodeReading` and `Console samples/Text and Code Reading` *with Python*                                                                                                                                                                               |

## Purpose

This sample program demonstrates how to:

- Read a 1D bar code in an image.

![](assets/images/sample_programs/text_and_code-easybarcoderead.webp)

## Code highlights

1. Read the bar codes present in the image.
   ```c++
   barCodes_ = barCodeReader_.Read(m_Source);
   ```
2. Retrieve the text encoded in the i^(th) bar code.
   ```c++
   m_DecodedText[i] = barCodes_[i].GetDecodedString();
   ```
3. Draw the position of the i^(th) bar code on the image.
   ```c++
   barCodes_[i].DrawPosition(drawAdapter, 1, 1, 0, 0);
   ```
