当前位置:首页 > 软件 > 资产管理EAM > NONE Dynamsoft Barcode Reader C/C ++ API for Mac 资产管理EAM

NONE Dynamsoft Barcode Reader C/C ++ API for Mac 资产管理EAM
  • NONE Dynamsoft Barcode Reader C/C ++ API for Mac 资产管理EAM

NONE Dynamsoft Barcode Reader C/C ++ API for Mac 资产管理EAM

价格:
立即询价
规格:
规格描述:
型号:
Dynamsoft Barcode Reader C/C ++ API for Mac
正版保证:
原装正品
品牌:
NONE品牌更多产品>>
质保服务:
货期:
现货
产品状态:
成熟产品
发票类型:
含13%货物增票
产品类型:
标准规格
物流费用:
包运费
品牌属国:
欧美品牌
支付方式:
公对公付款 公司支付宝
服务区域:
适用场景:
扫一扫,分享到手机 扫一扫,分享到手机
微信在线咨询
  • 商品详情
  • 同款比较
  • 售后服务

Dynamsoft Barcode Reader C/C ++ API for Mac

使用Dynamsoft Barcode Reader C/C ++ API for Mac

Dynamsoft Barcode Reader SDK为Mac提供C ++和C API。 您可以使用条形码API轻松创建Mac的条形码读取软件。在本文中,我将演示如何使用Mac的C ++条形码读取API在Mac OS上构建一维和二维条形码识别的命令行应用程序 X。

开始一个新文件

新建命令行工具

首先,让我们打开Xcode。

选择命令行工具作为项目模板,并在类型下选择C ++ stdc ++。 让我们将项目命名为BarcodeReaderDemo。

添加引用

在main.cpp中,请包括.H文件。

在我们的示例中,如果您在应用程序下安装了条形码阅读器,则路径将为“/ Applications / Dynamsoft / Barcode Reader 4.1 / Include / If_DBRP.h”。

#include

#include“/ Applications / Dynamsoft / Barcode Reader 4.1 / Include / If_DBRP.h”

复制主功能

接下来,插入下列代码到主功能

int main ( int argc, const char * argv[ ] )

{

//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: %drn%srn",

iRet,GetErrorString(iRet) );

return iRet;

}

//If DBR_OK

pBarcodeResultArray paryResult = NULL;

reader.GetBarcodes(&paryResult);

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

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

{

printf("Result %drn", iIndex + 1);

printf("PageNum: %drn", paryResult->

ppBarcodes[iIndex]->iPageNum);

printf("BarcodeFormat: %lldrn", paryResult->

ppBarcodes[iIndex]->llFormat);

printf("Text read: %srn", paryResult->

ppBarcodes[iIndex]->pBarcodeData);

}

//Finally release BarcodeResultArray

CBarcodeReader::FreeBarcodeResults(&paryResult);

return 0;

}

选择链接库

选择Targets – > BarcodeReaderDemo,单击信息按钮,在弹出的对话框中,addlibDynamsoftBarcodeReader.dylib依赖。

更新许可证和源映像

请在代码中分别使用有效值更新<您的映像文件完整路径>和<您的许可证密钥>。

对于图像路径,您可以在Images文件夹中使用AllSupportedBarcodeTypes.tif。

对于许可证密钥,请在BarcodeReaderTrialLic.txt中找到它。

const char * pszImageFile =“/ Applications / Dynamsoft / Barcode Reader 4.1 /

Images / AllSupportedBarcodeTypes.tif“;

现在你可以构建项目并运行。

条形码结果

请打开Terminal.APP 并运行该app并确认是否可行

在线咨询 电话沟通
提交需求 微信客服
二维码
二维码