How to decode DPM Data Matrix

Since version 7.2 of Dynamsoft Barcode Reader SDK, direct part mark (DPM) Data Matrix scanning is supported. To decode DPM codes, some particular settings are required:

  1. The value DPMCRM_GENERAL needs to be set for the parameter PublicRuntimeSettings->FurtherModes->DPMCodeReadingModes.

  2. The value LM_STATISTICS_MARKS needs to be set for the parameter PublicRuntimeSettings->LocalizationModes.

The following code shows how to set the runtime settings for DPM decoding:

C
C++
C#
Java
void *hBarcode = NULL;
char sError[512];
TextResultArray* pResult = NULL;
hBarcode = DBR_CreateInstance();
DBR_InitLicense(hBarcode,"put your license here");
DBR_GetRuntimeSettings(hBarcode, &runtimeSettings);
//turn on the DPM mode
runtimeSettings.furtherModes.dpmCodeReadingModes[0] = DPMCRM_GENERAL;
runtimeSettings.localizationModes[0] = LM_STATISTICS_MARKS;
//update the runtime settings
DBR_UpdateRuntimeSettings(hBarcode, &runtimeSettings, sError, 512);
DBR_DecodeFile(hBarcode, "put your file path here", "");
DBR_GetAllTextResults(hBarcode, &pResult);
DBR_FreeTextResults(&pResult);
DBR_DestroyInstance(hBarcode);
char sError[512];
TextResultArray* paryResult = NULL;
CBarcodeReader reader;
PublicRuntimeSettings* runtimeSettings = new PublicRuntimeSettings();
reader.InitLicense("<your license key here>");
reader.GetRuntimeSettings(runtimeSettings);
//turn on the DPM mode
runtimeSettings->furtherModes.dpmCodeReadingModes[0] = DPMCRM_GENERAL;
runtimeSettings->localizationModes[0] = LM_STATISTICS_MARKS;
//update the runtime settings
reader.UpdateRuntimeSettings(runtimeSettings, sError, 512);
reader.DecodeFile("<your image file full path>", "");
reader.GetAllTextResults(&paryResult);
CBarcodeReader::FreeTextResults(&paryResult);
BarcodeReader dbr = new BarcodeReader();
PublicRuntimeSettings runtimeSettings = dbr.GetRuntimeSettings();
dbr.ProductKeys = "Put your license key here";
//turn on the DPM mode
runtimeSettings.FurtherModes.DPMCodeReadingModes[0] = EnumDPMCodeReadingMode.DPMCRM_GENERAL;
//update the runtime settings
runtimeSettings.LocalizationModes[0] = EnumLocalizationMode.LM_STATISTICS_MARKS;
dbr.UpdateRuntimeSettings(runtimeSettings);
TextResult[] aryResult = dbr.DecodeFile("Put your file path here", "");
dbr.Dispose();
BarcodeReader dbr = new BarcodeReader("put your license here");
PublicRuntimeSettings settings = dbr.getRuntimeSettings();
settings.furtherModes.dpmCodeReadingModes[0] = EnumDPMCodeReadingMode.DPMCRM_GENERAL;
settings.localizationModes[0]= EnumLocalizationMode.LM_STATISTICS_MARKS;
dbr.updateRuntimeSettings(settings);
TextResult[] results = dbr.decodeFile("put your file path here", "");

results matching ""

    No results matching ""