簡體   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