如何看小区域在IOS

问题描述:

我要在我的应用程序在屏幕上的小区域打开相机打开相机,但没有得到如何实现它,因为相机全屏幕上打开genreally。 enter image description here如何看小区域在IOS

摄像机应该在uiimage视图区域打开,请指导我如何实现此目的。谢谢。

+0

具有u得到了你的问题的解决方案?我不得不打开相机的UIView,其尺寸为320 * 273。我也尝试过AVCam,但没有成功。 –

你应该看看AVCam样本项目提供苹果公司。它具有所有功能,您需要为您的任务。祝你好运!

我用我上一篇文章的代码进行了实验,并将最终的缩放比例变换((使其成为全尺寸的那个)进行了实验,最后我在屏幕中间浮动了一个可爱的微型相机imagePicker,所以!绝对不工作的确切代码我使用,包括变焦/淡入过渡,是 -

UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; 

imagePickerController.delegate = self; 
imagePickerController.mediaTypes = [NSArray arrayWithObjects:(NSString *)kUTTypeImage, nil]; 
imagePickerController.sourceType = UIImagePickerControllerSourceTypeCamera; 
imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto; 

UIView *controllerView = imagePickerController.view; 

controllerView.alpha = 0.0; 
controllerView.transform = CGAffineTransformMakeScale(0.5, 0.5); 

[[[[UIApplication sharedApplication] delegate] window] addSubview:controllerView]; 

[UIView animateWithDuration:0.3 
       delay:0.0 
      options:UIViewAnimationOptionCurveLinear 
     animations:^{ 
      controllerView.alpha = 1.0; 
     } 
     completion:nil 
]; 

[imagePickerController release]; 

你可以通过我的答案here.