Search This Blog

Jul 13, 2010

How to use camera as backgroud view in iPhone app

This action starts camera as a backgroud of the view:-

-(IBAction)btnStartCamera_TouchUpInside{
picker = [[UIImagePickerController alloc] init];
#if TARGET_IPHONE_SIMULATOR
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.view = viewCategoryCamera;
#elif TARGET_OS_IPHONE
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.showsCameraControls = NO;
[picker.view addSubview:viewCategoryCamera];
//picker.cameraOverlayView = viewCamera;
#endif
[self presentModalViewController:picker animated:YES];
}

This action stops camera:-

-(IBAction)btnStopCamera_TouchUpInside:(id)sender{
[self dismissModalViewControllerAnimated:YES];
[self.navigationController popToRootViewControllerAnimated:YES];
}




No comments:

Post a Comment