繁体   English   中英

相机叠加标签问题

[英]camera overlay label issue

我正在为相机叠加添加标签,我成功添加了它

但我所面对的是标签也出现在拍摄照片的预览中

我想在相机覆盖中显示标签而不是在拍摄图片的预览中添加标签我使用以下代码

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];

任何人都可以帮我怎么做那件事......

您需要根据叠加尺寸裁剪图像。 您可以尝试本教程 ,它提供了一个很好的解释。

从iOS4.0开始,从相机捕获的图像与其exif数据和旋转信息一起保存。 因此,您无法像使用UIImage那样以标准方式裁剪它们上面的链接专门处理从相机捕获的图像。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM