3

i am adding a label to camera overlay and i successfully added it

but what i am facing is the label is also appearing in preview of the taken picture

i want to display the label in camera overlay not in preview of the taken picture for adding label i am using the following code

UIView *overlayView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
overlayView.opaque = NO;
overlayView.backgroundColor = [UIColor clearColor];
[overlayView addSubview:topImgView];
[overlayView addSubview:btnInfo];
[overlayView bringSubviewToFront:btnInfo];

UILabel *label          =[[UILabel alloc]initWithFrame:CGRectMake(20, 0,290,150)];
 label.text              =@"Hold the bottle steady, left align the prescription label, and then take the photo";
 label.backgroundColor = [UIColor clearColor];
 label.numberOfLines = 2;
 label.textAlignment = UITextAlignmentCenter;
 label.font = [UIFont boldSystemFontOfSize:14.0];
 label.textColor = [UIColor whiteColor];
 [overlayView addSubview:label];
 _infoLabel  =label;
 [label release];


//Image picker
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType =  UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
imagePicker.cameraOverlayView=overlayView;
[self presentModalViewController:imagePicker animated:YES]; 
_imagePicker =imagePicker;
[imagePicker release];
[topImgView release];
[overlayView release];

can any one please help me how to do that thing...

user564963
  • 2,284
  • 5
  • 24
  • 33

1 Answers1

0

You need to crop the image based on your overlay dimensions. You could try this tutorial which provides a good explanation.

Beginning iOS4.0, the images captured from camera are saved along with their exif data and rotation information. So, you cannot crop them in the standard way as you would with the UIImages The link above deals specifically with images captured from camera.

Sagar Hatekar
  • 8,700
  • 14
  • 56
  • 72