一本清日本在线视频精品,亚洲日本va午夜在线影院,国产精品麻花传媒二三区别,色屁屁www免费看欧美激情

010-68421378
產(chǎn)品分類
AddFlow  AmCharts JavaScript Stock Chart AmCharts 4: Charts Aspose.Total for Java Altova SchemaAgent Altova DatabaseSpy Altova MobileTogether Altova UModel  Altova MapForce Altova MapForce Server Altova Authentic Aspose.Total for .NET Altova RaptorXML Server ComponentOne Ultimate Chart FX for SharePoint Chart FX CodeCharge Studio ComponentOne Enterprise combit Report Server Controls for Visual C++ MFC Chart Pro for Visual C ++ MFC DbVisualizer version 12.1 DemoCharge DXperience Subscription .NET DevExpress Universal Subscription Essential Studio for ASP.NET MVC FusionCharts Suite XT FusionCharts for Flex  FusionExport V2.0 GrapeCity TX Text Control .NET for WPF GrapeCity Spread Studio Highcharts Gantt Highcharts 10.0 版 HelpNDoc Infragistics Ultimate  ImageKit9 ActiveX ImageKit.NET JetBrains--Fleet JetBrains-DataSpell JetBrains--DataGrip jQuery EasyUI jChart FX Plus OPC DA .NET Server Toolkit  OSS ASN.1/C Oxygen XML Author  OSS 4G NAS/C, C++ Encoder Decoder Library OSS ASN.1 Tools for C with 4G S1/X2 OSS ASN.1/C# OSS ASN.1/C++ OPC HDA .NET Server Toolkit OPC DA .Net Client Development Component PowerBuilder redgate NET Developer Bundle Report Control for Visual C++ MFC  Sencha Test SPC Control Chart Tools for .Net Stimulsoft Reports.PHP Stimulsoft Reports.JS Stimulsoft Reports.Java Stimulsoft Reports. Ultimate Stimulsoft Reports.Wpf Stimulsoft Reports.Silverlight SlickEdit Source Insight Software Verify .Net Coverage Validator Toolkit Pro for VisualC++MFC TeeChart .NET Telerik DevCraft Complete Altova XMLSpy Zend Server

Dynamsoft Barcode Reader C C++ API

在Windows里使用Dynamsoft Barcode Reader C++ API

在Windows桌面應(yīng)用程序Dynamsoft的C ++條形碼閱讀器庫(kù)為Windows允許你幾乎立即嵌入一維和二維條碼閱讀功能。我將演示如何使用C ++條形碼閱讀API的Windows構(gòu)建一個(gè)Win32控制臺(tái)應(yīng)用程序條形碼識(shí)別。

開(kāi)始一個(gè)新文件

新的控制臺(tái)應(yīng)用程序

首先,讓我們打開(kāi)Visual Studio。

通過(guò)Visual C ++> Win32創(chuàng)建一個(gè)空的Win32控制臺(tái)應(yīng)用程序項(xiàng)目。

讓我們把它命名為BarcodeReaderC ++ API

添加引用

按照本指南,首先,引用.H和.LIB文件。 為了更容易,讓我們從包含文件夾和lib文件夾從安裝目錄復(fù)制到項(xiàng)目。

在此處更改相對(duì)路徑。

#include

#include "/If_DBRP.h"

#ifdef _WIN64

#pragma comment ( lib, "/x64/DBRx64.lib" )

#else

#pragma comment ( lib, "/x86/DBRx86.lib" )

#endif

復(fù)制主函數(shù)

接下來(lái),將以下代碼插入主函數(shù)。

 

//Define variables

const char * pszImageFile = "";

int iIndex = 0;

int iRet = -1;

       

//Initialize license prior to any decoding

CBarcodeReader reader;

reader.InitLicense("");

 

//Initialize ReaderOptions

ReaderOptions ro = {0};          

ro.llBarcodeFormat = OneD;   //Expected barcode types to read.

ro.iMaxBarcodesNumPerPage = 100;     //Expected barcode numbers to read.

reader.SetReaderOptions(ro);

 

//Start decoding

iRet = reader.DecodeFile(pszImageFile);

 

//If not DBR_OK

if (iRet != DBR_OK)

{

  printf("Failed to read barcode: %d\r\n%s\r\n",iRet, GetErrorString(iRet));

  return iRet;

}

 

//If DBR_OK

pBarcodeResultArray paryResult = NULL;

reader.GetBarcodes(&paryResult);

printf("%d total barcodes found. \r\n", paryResult->iBarcodeCount);

for (iIndex = 0; iIndex < paryResult->iBarcodeCount; iIndex++)

{

  printf("Result %d\r\n", iIndex + 1);

  printf("PageNum: %d\r\n", paryResult->ppBarcodes[iIndex]->iPageNum);

  printf("BarcodeFormat: %lld\r\n", paryResult->ppBarcodes[iIndex]->llFormat);

  printf("Text read: %s\r\n", paryResult->ppBarcodes[iIndex]->pBarcodeData);

}

 

//Finally release BarcodeResultArray

CBarcodeReader::FreeBarcodeResults(&paryResult);

升級(jí)源圖片

改變圖片路徑。我將會(huì)用一個(gè)例子圖片Change the image path. I am going to use a sample image from the installation folder. Copy the file path, add the escape character, and then the file name. Change the path to "C:\\Program Files (x86)\\Dynamsoft\\Barcode Reader 4.1\\Images\\AllSupportedBarcodeTypes.tif".

 

const char * pszImageFile = "C:\\Program Files (x86)\\Dynamsoft\\Barcode

 Reader 4.1\\Images\\AllSupportedBarcodeTypes.tif";

             

Build the project. Build Succeeded.

復(fù)制條碼DLL

轉(zhuǎn)到安裝目錄,在Components \ C_C ++ \ Redist文件夾下,復(fù)制這兩個(gè)DLL - DynamsoftBarcodeReaderx86.dll和DynamsoftBarcodeReaderx64.dll。 將其粘貼到與BarcodeReaderC ++ API.exe相同的文件夾中,默認(rèn)情況下,該文件位于解決方案的Debug文件夾下。

按Ctrl + F5運(yùn)行項(xiàng)目。 好。 我們已經(jīng)識(shí)別所有的條形碼。

查看代碼

現(xiàn)在,讓我們快速瀏覽代碼。 首先,我們定義包括圖像路徑的變量。 然后我們配置許可證信息。 使用此片段,我們初始化條形碼閱讀選項(xiàng),如條形碼類型,以及每頁(yè)讀取多少條形碼。 調(diào)用DecodeFile方法來(lái)解碼條形碼。 如果找到多個(gè)條形碼,我們使用循環(huán)逐個(gè)打印出結(jié)果。

//Start decoding

iRet = reader.DecodeFile(pszImageFile);

 

//If not DBR_OK

if (iRet != DBR_OK)

{

  printf("Failed to read barcode: %d\r\n%s\r\n",iRet, GetErrorString(iRet));

  return iRet;

}

 

//If DBR_OK

pBarcodeResultArray paryResult = NULL;

reader.GetBarcodes(&paryResult);

printf("%d total barcodes found. \r\n", paryResult->iBarcodeCount);

for (iIndex = 0; iIndex < paryResult->iBarcodeCount; iIndex++)

{

  printf("Result %d\r\n", iIndex + 1);

  printf("PageNum: %d\r\n", paryResult->ppBarcodes[iIndex]->iPageNum);

  printf("BarcodeFormat: %lld\r\n", paryResult->ppBarcodes[iIndex]->llFormat);

  printf("Text read: %s\r\n", paryResult->ppBarcodes[iIndex]->pBarcodeData);

}

記住要釋放BarcodeResultArray

最后但也同樣重要,我們需要釋放BarcodeResultArray。 請(qǐng)注意這一步很重要。

//Finally release BarcodeResultArray

CBarcodeReader::FreeBarcodeResults(&paryResult);

其他條形碼閱讀功能

最后,如果要從圖像的特定區(qū)域解碼條形碼,則有一個(gè)DecodeFileRect方法。 Dynamsoft的條形碼讀取器SDK還支持從設(shè)備無(wú)關(guān)位圖(也稱為DIB),緩沖區(qū)和base64字符串讀取條形碼。

快速導(dǎo)航

                               

 京ICP備09015132號(hào)-996 | 違法和不良信息舉報(bào)電話:4006561155

                                   © Copyright 2000-2026 北京哲想軟件有限公司版權(quán)所有 | 地址:北京市海淀區(qū)西三環(huán)北路50號(hào)豪柏大廈C2座11層1105室

                         北京哲想軟件集團(tuán)旗下網(wǎng)站:哲想軟件 | 哲想動(dòng)畫

                            華滋生物