NOTE: This page has been translated automatically from Russian to English. Original page.



Recognize QR barcodes, EAN-13, Code 128 with the aid of 1C and a web camera

The external component will recognize the bar code using ordinary Web camera. Able to work with UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 128, QR Code, Interleaved 2 of 5, Codabar, RSS-14, Data Matrix, PDF 417, Aztec, MaxiCode.

Preface.


It is easy to notice that in the vastness of the Internet quite a lot of development to generate barcode of different type. Many are used as online services, others - as a separate application, and finally - as external components, including for 1C. However, the latter, even if generated in 1C, already recognized it may not be. The search for solutions how to recognize the bar code take a long time and have been unsuccessful - so it was decided to create ActiveX for recognizing barcodes.


Tehnologiya.Kamera


Using the camera by using avicap32.dll library. Thanks to her, the same method has been implemented PoluchitImyaUstroystva (index) returns the name of the driver, which can be used to build a list of video data input devices.


Tehnologiya.RaspoznovanieShtrihKoda


There is no need to reinvent the wheel, because it already has a proven library of recognition:
2.1-ZXing *
The Barcode MessagingToolkit *
* Library are free for non-commercial use.


The choice fell on the latter, because of the greater processing speed, however, I note that after many complex barcode recognition tests (such as PDF 317 and CODE 128) ZXing percentage error was comparatively lower.


VneshnyayaKomponenta.Ispolzovanie

Unfortunately, at the time of writing this article did not resolve the problem of using a library for both customers, so to use the component in a thick client used Shakmaev.Decoder.dll, for fine Shakmaev. T Decoder.dll.
To start working with the component, make sure that the computer is running Microsoft Framework 4.
Then it is necessary to register with the command:
% SystemRoot% \ Microsoft.NET \ Framework \ v4.0.30319 \ RegAsm.exe ". \ Shakmaev.Decoder.dll" / codebase
avicap32.dll and copy the file (save the old file if it already exists) in the folder \ Windows \ System32.
To facilitate the work in the folder you will find a VC BAT file (Registry.bat), which will help to make all of this automatically.


[Thick Client]

Library for use with conventional forms Shakmaev.Decoder.dll [GUID: 779D9FB8-C4A3-40c2-9E08-296CDAF1165F]
If all the work has been done correctly, the windows form-Insert ActiveX list should appear Shakmaev.Decoder line. Before you begin, you must specify what types of codes you will try to recognize it. For this type IskatH parameters exist, wherein X - is any from the list of supported barcode types (e.g. IskatQR):
UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 128, QR Code, Interleaved 2 of 5, Codabar, RSS-14, Data Matrix, PDF 417, Aztec, MaxiCode.
For convenience, there is a parameter in the VC "IspolzovatSignal", if set it to "True", then when the function "RaspoznatKod ()" system speaker should make a sound. Unfortunately, this only works in x86 operating system architecture.
Details in the treatment of "the Decoder" archive project, a form of "ObychnayaForma".

[Thin client, Web-client]

Library for use with controlled shapes Shakmaev.TDecoder.dll [GUID: AE078288-5E41-4316-95FF-33AFE7753168]
To get the correct ActiveX works in a managed application is necessary in your browser's preferences allow execution of ActiveX scripts and everything connected with them. The functions and settings available in a typical application here work similarly.
Details in the treatment of "the Decoder" archive project, a form of "UpravlyaemayaForma".

[UPD 27.08.2013]

Any action related to the registration of the components, you have to perform an administrator.

// RegAsm Error: error RA0000: An error occurred while recording the registration information to the registry .//

Coming soon likely, you do not have access rights to the HKEY_CLASSES_ROOT registry branch.
deytvy algorithm is as follows:

1. Click Start - Run

2. Writing regedit, and press Enter

3. We click the right mouse button on the branch HKEY_CLASSES_ROOT and choose "Permissions"

4. Select the Administrators group

5. Make sure the item "Full Control" is checked, otherwise mark it.

6. Click "Apply" and "OK"

7. The installation should be successful. Reboot if necessary.

// RegAsm Error: error RA0000: Unable to locate input assembly. 'The way the quotes' //

The error due to the fact that the check program could not find a library file. component library should be in the same folder as the bat file.

1C:Enterprise Developer's Community