简体   繁体   中英

zbar sdk not working on iphone simulator by using camera simulator

I have to support barcode scanning on my project. I'm using zbar sdk for that.I have integrated the code and run using iphone simulator. I'm using camera simulator for scanning barcode.Its opening the barcode image correctly.but barcode scanning not working. Anyone used this?

you can test bar code on iPhone Simulator,

1 - save the bar code to you simulator, open safari and drag drop the barcode image into safari and then long tap the image, I'll ask you to save the image.

2 - run simulator and when on barcode scan screen press "optons+threefingres long tap" it'll open the gallery where you can select the saved barcode image, then It'll scan that image.

除非您正在测试相机不可用时的代码路径,否则您将需要一个实际设备来测试使用zbar sdk的代码。

Fixed It. It was the problem of barcode images. I tried few small barcode images and one worked.So try multiple small barcodes,and at last one will work. More Important the orientation of image should be like this. 在此输入图像描述

Just as additional information :

I drop the image on the simulator and use the two-fingers long tap to open them (as has been pointed out already) , but in my experience it seems that you need to have enough space around the images before zbar can identify them.

So add enough white space around the image and it will probably start to work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM