i've got a ZBarReaderView created from storyboard with 300*90 px which is shown as roughly 200*400 px because ZBarReaderView doesn't take it's size too serious...
I Declare my IBOutlets as so:
@interface MYQViewController : UIViewController < ZBarReaderViewDelegate >
{
ZBarReaderView *readerView;
ZBarCameraSimulator *cameraSim;
UITextView *resultText;
}
@property (strong, nonatomic) IBOutlet ZBarReaderView *readerView;
@property (strong, nonatomic) IBOutlet UITextView *resultText;
@end
in the viewDidLoad
-(void) viewDidLoad
{
readerView.readerDelegate = self;
readerView.zoom=1;
if(TAGET_IPONE_SIMULATOR)
{
cameraSim=[[ZBarCameraSimulator alloc] initWithViewController:self];
cameraSim.readerView=readerView;
}
}
-(void)Scan
{
if(readerView.hidden)
{
[readerView start];
readerView.hidden = NO;
resultText.text=EMPTY_STRING;
}
else
{
[readerView stop];
readerView.hidden = YES;
//OTHER CODES
}
}
-(void) readerView:(ZBarReaderView *)readerView didReadSymbols:(ZBarSymbolSet * )symbolsfromImage:(UIImage *)image
{
for (ZBarSymol *sym in symbols)
{
self.resultText.text=sym.data;
break;
}
}