1

I'd like to display the camera view on only half the screen on both iPhone and iPad. I've done a lot of searching, but haven't found a solution.

jscs
  • 63,694
  • 13
  • 151
  • 195
Megha Mishty
  • 61
  • 2
  • 11
  • Thats not a big deal first of all tell me ... u r writing code for iPhone or iPad ? –  May 02 '12 at 04:52
  • What u need in the remaining portion?add a camera overlay to half of your screen.Follow this tutorial for adding a camera overlay.You can add buttons or backgrounds or images or anything else as the overlay. – iOS Developer May 02 '12 at 04:55
  • I have created universal app...For iphone and ipad both – Megha Mishty May 02 '12 at 04:55
  • @annu - In another half portion I want to put lables and textboxes – Megha Mishty May 02 '12 at 04:57
  • sorry see this link http://www.musicalgeometry.com/?p=821 – iOS Developer May 02 '12 at 04:59
  • @MeghaMishty let me know if u hav any querries..and accept the answer if u find it useful..:) – iOS Developer May 02 '12 at 05:07
  • CGAffineTransform translate = CGAffineTransformMakeTranslation(0.0, 27.0); imagePickerController.cameraViewTransform = translate; –  May 02 '12 at 05:11
  • The main line of code is picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, CAMERA_TRANSFORM_X, CAMERA_TRANSFORM_Y); –  May 02 '12 at 05:13

1 Answers1

3

try with this .. if this is not help full for you or facing any problem, tell me i will provide you some other sample code ..

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];
KingofBliss
  • 15,055
  • 6
  • 50
  • 72