2

Im building an application for IPad and I am using ZBar.

The image containing the barcode data is a UIImage called TempUIImage. How can I use ZBar to detect the value of the barcode and it's location.

Note: I don't want want the camera preview at all as the TempUIImage is an UIImage that should be taken from another application.

Hazem Abdullah
  • 1,837
  • 4
  • 23
  • 41

2 Answers2

0

You can use ZBarImageScanner class. Here there is a complete documentation ZBarImageScanner

Here there is an example on how to use it (I don't tested it on device):

ZBarImageScanner *scanner = [[ZBarImageScanner alloc]init];
NSInteger resultsnumber = [scanner scanImage:yourUIImage];
if(resultsnumber > 0){
    ZBarSymbolSet *results = scanner.results;
    //do whatever u want with results!!!
}
Jacopo Berta
  • 265
  • 2
  • 14
0

i was also facing this issue in one of my project, i solved the issue by making an object of ZBarImageScanner as

ZBarImageScanner *scanner

See my answer at Scaning static UIImage using ios ZBar SDK for details

Community
  • 1
  • 1
Baig
  • 4,737
  • 1
  • 32
  • 47