2

I'm using Camera API and invoking the camera.

I want to display a header (for branding) on the top of the camera preview. The header is a png image.

Is it possible? Any help appreciated.

Thanks in advance.

Rahul Sharma
  • 264
  • 1
  • 17

2 Answers2

0

You set overlay view of camera. Check below link. It will help you the solve the problem.

https://stackoverflow.com/a/8101616/1850983

Community
  • 1
  • 1
Payal Maniyar
  • 3,685
  • 20
  • 47
0
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {

        self.imgPickerCamera = [[UIImagePickerController alloc] init];
        self.imgPickerCamera.delegate = self;
        self.imgPickerCamera.allowsEditing = YES;

        self.imgPickerCamera.sourceType = UIImagePickerControllerSourceTypeCamera;


        self.imgPickerCamera.navigationBarHidden = NO;
        UIImageView *imageView = [[UIImageView alloc] initWithImage:@"<Your image>"];
        imageView.frame = <set frame>;

        //setting navigation bar
        self.imgPickerCamera.navigationController.navigationItem.titleView = imageView;

        // Insert the overlay: OverlayView is a UIView
        OverlayView *overlay = [[OverlayView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width,1024) withImagePicker:self.imgPickerCamera];


        self.imgPickerCamera.cameraOverlayView = overlay;

        [self presentViewController:self.imgPickerCamera animated:YES completion:NULL];

    } else {

        [self showAlertWithOKButton:@"Error" message:@"Your device doesn't have camera."];
    }
Mahendra
  • 7,012
  • 2
  • 25
  • 50