Tag: uiimagepickercontroller

在segue之后,无法在下一个ViewController上从UIImagePickerController加载图像

我正试图加载在下一个视图控制器上的UIImagePickerController上select的图片。 我做了一些类似的线程search,发现了一些帮助我设置,但图像并没有真正转移到下一个视图控制器。 这是我didFinishPickingImage和prepareForSegue的代码: – (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo { self.imageChosen = image; [picker dismissModalViewControllerAnimated:NO]; [self performSegueWithIdentifier:@"Edit" sender:self]; } – (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"Edit"]){ EditViewController *editViewController = (EditViewController *)segue.destinationViewController; editViewController.imageView.image = self.imageChosen; } 我得到的EditViewController运行到EditViewController ,但EditViewController没有加载图片。 我猜这个任务是错误的,但是我看不出来。

iOS 6中的UIImagePickerController无法正常工作

我有一个非常奇怪的行为: 在iOS 5中,我以这种方式呈现UIImagePickerController : imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.modalPresentationStyle = UIModalPresentationFullScreen; imagePicker.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:imagePicker animated:YES]; 现在在iOS 6中,这会导致崩溃。 我通过在UIImagePickerController上编写一个类来解决崩溃问题: @implementation UIImagePickerController (NonRotating) – (BOOL)shouldAutorotate { return NO; } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationMaskPortrait; } – (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } @end 问题是,现在的UIImagePickerController不旋转,它显示正面。 而且,当我按下“取消”button,选取器被解雇,应用程序再次崩溃。 如果我在UIPopoverController使用UIImagePickerController ,所有工作正常(属于UIPopoverController不旋转的事实),但是当我closures在我的应用程序的popup窗口所有视图控制器停止响应旋转事件 ,这导致所有的应用程序被阻止在这个方向。 要恢复正确的行为,我需要从后台退出应用程序,然后再次打开。 这是我用来显示popover的代码 _cameraPopoverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker]; [_cameraPopoverController presentPopoverFromRect:_takeFromCamera.frame […]

所选图像xcode的名称

我想获得从图书馆采摘的图像的名称或新点击 – -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info 我正在使用这个代码: -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeSavedPhotosAlbum]) { AppDelegate *del = [[UIApplication sharedApplication]delegate]; [self dismissModalViewControllerAnimated:YES]; image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSLog(@"imagekbgfg=====>%@",image); [self.imageView setImage:image]; imgName = [info objectForKey:UIImagePickerControllerOriginalImage]; del.mainImgName = imgName; del.imageData = UIImageJPEGRepresentation(image, 1.0); del.imageApp = image; } if ([UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { image = […]

UIImagePickerController不会从/ tmp / capture中删除临时video捕获文件

我的应用程序使用UIImagePickerController录制video并将其保存到相机胶卷上,但问题是录制的video也保存在/ tmp / capture目录中,不会被删除。 我的应用程序使用很多不必要的数据,因此缓慢地累积了存储在tmp / capture目录中的一长串video。 我正在使用ARC和iOS7 SDK。 -(BOOL)startCameraControllerFromViewController:(UIViewController*)controller usingDelegate:(id )delegate forType: (int)type { if (([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO) || (delegate == nil) || (controller == nil)) { return NO; } UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init]; cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera; if(type == IMAGE ) cameraUI.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeImage, nil]; if(type == VIDEO) […]

如何使用Frank Cucumber从UIImagePickerController中select图片?

我试图使用BDD技术来检查在iPhone模拟器中使用Frank的导入图片处理。 问题是,我不能调用从UIImagePickerControllerSourceTypePhotoLibrary源select图像的最后一步(启动UIImagePickerController是很容易使用“触摸” – button上的命令)。 当我看到模拟器中保存的图像时,它总是卡在进度中。 弗兰克Symbiote说,我想触摸的对象是一个“PLAlbumViewCell”的对象。

图像拼贴的不同形状

我是照片编辑应用程序开发的新手。 我如何开发像这样的网格样式,以便我可以添加从相机中挑选的多个图像来创build拼贴画? 我通过下面的链接,但没有得到实现这一目标的方式。 任何build议或链接将有所帮助。 LINK1 LINK2

AVCaptureSession VS UIImagePickerController相机预览

我正在开发一个类似于Instagram iOS应用程序的应用程序。 Instagram有一个自定义相机预览。 我想开发类似的东西,问题是 – 什么更好的用于这个目的 – 具有自定义cameraOverlayView属性的UIImagePickerController还是应该使用AVCaptureSession? 也许有人有这样的经验,可以给我一个build议。 将不胜感激。

如何快速在照片库或相机中裁剪4 * 3图像

我想在使用相机后裁剪图像或从photoLibrary中select。 现在,我只能裁剪方形图像,我不知道如何裁剪4 * 3的图像。 这是我的代码的一部分 let imagePicker : UIImagePickerController = UIImagePickerController() imagePicker.delegate = self imagePicker.sourceType = .PhotoLibrary imagePicker.allowsEditing = true

关于iOS 5中的UIImagePickerController的api

我用我的devise覆盖了UIImagePickerController ,并设置了showsCameraControls = NO,缩放栏不会在iOS 4和iOS 5中显示,但缩放function将在iOS 5中运行,我可以使用两个手指放大进/出,但我不希望这个function,所以我怎样才能停止缩放function? 我无法在iOS 5开发者文件中find这个API,所以请帮助我。谢谢

UIImagePickerController偶尔会冻结

我在Unity应用程序中使用UIImagePickerController 。 当用户按下“完成”时它偶尔会冻结。 它经常发生在3GS上 – 大约每三次 – 但我也偶尔在iPhone 5上冻结。这个错误出现在iOS 4.3到7.0。 我无法确定哪些因素与冻结相关。 当我得到这个冻结时,我也没有得到记忆警告。 日志中没有错误,没有crashlog。 正常情况下,应用程序继续在UIImagePickerController后面运行。 在控制台中有很多看起来相关的消息,比如“deny file-write-data / private / var / mobile / Media / PhotoData”,但是当冻结出现时以及一切正在工作时,它们偶尔都会出现好的。 以下是我如何显示选取器: – (void)showPicker:(UIImagePickerControllerSourceType)type { imgPicker = [[[CustomPhotoPicker alloc] init] autorelease]; imgPicker.delegate = self; imgPicker.sourceType = type; imgPicker.allowsEditing = _pickerAllowsEditing; // wrap and show the modal [self showViewControllerModallyInWrapper:imgPicker]; } 这里是委托方法: […]