Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7736485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:44:36+00:00 2026-06-01T07:44:36+00:00

I an using Zbar SDK and want to scan QRcode and barcode in my

  • 0

I an using Zbar SDK and want to scan QRcode and barcode in my define frame but it is scanning in any part of screen not in my defined frame so where i am doing mistake?
I want to do scan like this in my defined frame.
http://www.visionsmarts.com/products/VSBarcodeReader/VSBarcodeReader.html

here is my code.

-(void)displayMe{


ZBarReaderViewController *reader = [ZBarReaderViewController new];
reader.readerDelegate = self;

reader.showsZBarControls=NO;

//////////////black area/////////////////////////

UIImage *image1 = [UIImage imageNamed:@"blackscreen.png"];
UIImageView *imageLogo1 = [[UIImageView alloc] initWithImage:image1];
imageLogo1.frame = CGRectMake(0, 0, 320, 480);

cancelLabel =[[UILabel alloc]initWithFrame:CGRectMake(0,420, 320, 60)];
cancelLabel.backgroundColor = [UIColor blackColor];


UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setFrame:CGRectMake(100,420, 100, 60)];
[btn setTitle:@"Cancel" forState:UIControlStateNormal]; 
btn.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:18];
btn.backgroundColor=[UIColor blackColor];
[btn addTarget:self action:@selector(back) 
forControlEvents:UIControlEventTouchUpInside];


[cancelLabel bringSubviewToFront:btn];
[imageLogo1 addSubview:cancelLabel];
[imageLogo1 setUserInteractionEnabled:YES];
[imageLogo1 addSubview:btn];
//reader.cameraOverlayView = btn;


///////////////line/////////////////////////////
UIImage *image = [UIImage imageNamed:@"ScannerKitLaser@2x.png"];
UIImageView *imageLogo = [[UIImageView alloc] initWithImage:image];
imageLogo.frame = CGRectMake(40, 240, 230, 10);
[imageLogo1 addSubview:imageLogo];

///////////////Configure reader///////////////////////////////
reader.cameraOverlayView = imageLogo1;

//reader.cameraOverlayView.frame=CGRectMake(40, 240, 230, 30);

//imageLogo.frame = CGRectMake(0, 0, image.size.width, image.size.height);


//imageLogo.center = CGRectMake(320/2, 460/2, image.size.width, image.size.height);

ZBarImageScanner *scanner = reader.scanner;

[scanner setSymbology: ZBAR_I25
               config: ZBAR_CFG_ENABLE
                   to: 1];


ZBarCaptureReader *cap=[[ZBarCaptureReader alloc]init];

//cap.scanCrop=CGRectMake(300, 400, 230, 200);

cap.scanCrop=CGRectMake(100, 160, 50,60);
//cap.cameraOverlayView.frame=CGRectMake(40, 240, 230, 30);


[self presentModalViewController: reader
                        animated: YES];
[reader release];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T07:44:38+00:00Added an answer on June 1, 2026 at 7:44 am

    Make a UIVIew (e.g. scanView) object and make it as your customize area. Where u want to get scan area there should be transparent area or In image transparent cut.

    use this

    reader.cameraOverlayView = scanView;
    

    Also disable to all mode except Portrait mode.

    reader.supportedOrientationsMask = ZBarOrientationMask(UIInterfaceOrientationPortrait);
    

    Full e.g. code

    In MyScanCode.h file

    {ZBarReaderViewController *reader;}
    @property (nonatomic, strong) IBOutlet UIView *scanView;
    

    In MyScanCode.m file

    - (void) readCode{
        reader = [ZBarReaderViewController new];
    
        reader.readerDelegate =  self;
        reader.supportedOrientationsMask = ZBarOrientationMask(UIInterfaceOrientationPortrait);
    
        #if !(TARGET_IPHONE_SIMULATOR)    
            reader.cameraOverlayView = scanView;
            reader.showsZBarControls = NO;
        #endif
    
        reader.wantsFullScreenLayout = NO;
        ZBarImageScanner *scanner = reader.scanner;
    
        [scanner setSymbology:ZBAR_I25 config: ZBAR_CFG_ENABLE to: 0];
        [self presentModalViewController:reader animated:NO];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using zbar sdk in my project but it is not scanning barcode
I am using ZBar iOS SDK to scan VIN barcodes on an app. But
In my app i am using zbar sdk to scan ticket and i want
Am developing sample barcode scanner app. I using ZBar API to scan the barcode
I am building an iOS, code scanner project using ZBar SDK . I am
I am using ZBar iPhone SDK in one of my projects (iOS SDK 5.1
I am trying to write the embedded reader example in ZBar SDK using a
I developing Barcode Scanner sample app in iPhone. Am using ZBar framework in iphone,
I am using zbarcam to read barcode from a webcam in my webapps. But,
I am currently using ZBar for scanning and while it does work very well,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.