2011-12-29 120 views
3

我增加了標籤,攝像頭的覆蓋和我成功添加它相機覆蓋標籤問題

但我所面對的標籤也出現在拍攝照片的預覽

我想要顯示的在攝像頭覆蓋的標籤沒有添加標籤的拍攝照片的預覽我用下面的代碼

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    [email protected]"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]; 

任何一個可以請幫我該怎麼做的事...

回答

0

您需要根據疊加層尺寸裁剪圖像。你可以嘗試this tutorial這提供了一個很好的解釋。

從iOS4.0開始,將從相機捕獲的圖像與其exif數據和旋轉信息一起保存。因此,您不能像使用UIImage那樣以標準方式裁剪它們。上面的鏈接特別涉及從相機捕獲的圖像。