2012-06-19 73 views
0

我調用的UIImagePickerController的方法takePicture方法以編程方式與iPhone的UIImagePickerController:調用takePicture無快門動畫

但是我想禁用拱架動畫,剛剛離開屏幕,因爲它是,當畫面的畫面被採取(並且禁用聲音)。

UPDATE 我現在使用AVFoundation API來獲取圖像,而不是在屏幕上不再顯示攝像機的內容。我是否應該初始化一個UIImagePickerController來顯示相機在屏幕上的內容?

感謝

回答

-1

我覺得這很有用3.0

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 
{ 

    NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType]; 
    if ([mediaType isEqualToString:@"public.image"]) 
    { 
     UIImage *selectedImage = [info objectForKey:UIImagePickerControllerOriginalImage]; 


     UIImage * cameraimage= [self scaleAndRotateImage:selectedImage]; 

     CGRect rect =CGRectMake(0, 0,640,875);   
     CGImageRef imageRef = CGImageCreateWithImageInRect([selectedImage CGImage], rect); 
     UIImage *img = [UIImage imageWithCGImage:imageRef]; 
     CGImageRelease(imageRef); 
     self.captureimage.image=cameraimage; 

     NSLog(@"selectedimage width:%f ht:%f",img.size.width,img.size.height); 
    } 
    [picker dismissModalViewControllerAnimated:YES]; 
} 
相關問題