uiimagepickercontroller

presentModalViewController:Animated is deprecated in ios6

流过昼夜 提交于 2019-11-28 03:25:43
I am using the following code for an image picker. But when I run it in the simulator, I have a memory leak and I get a warning about presentModalViewcontroller:animated being deprecated in iOS6. I also get dismissModalViewController:animated deprecated. I'm using the SDK 6.1. Code for ImagePicker: - (void)showAlbum:(id)sender { imagePicker=[[UIImagePickerController alloc]init]; imagePicker.delegate = self; imagePicker.allowsEditing =NO; imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:imagePicker animated:YES]; } - (void

Front facing camera in UIImagePickerController

家住魔仙堡 提交于 2019-11-28 03:05:40
I am developing the front facing camera app in iPad2 by using the UIImagePickerController . When I capture the image it's shows as flipped from left to right. How do I correct this? if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { UIImagePickerController *imgPkr = [[UIImagePickerController alloc] init]; imgPkr.delegate = self; imgPkr.sourceType = UIImagePickerControllerSourceTypeCamera; imgPkr.cameraDevice=UIImagePickerControllerCameraDeviceFront; UIImageView *anImageView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString

How to take a photo on the volume-up event when using UIImagePickerController with custom camera controls?

笑着哭i 提交于 2019-11-28 02:25:55
问题 In iOS 5, the volume-up button will now take a photo in the camera app, and on a UIImagePickerController instance where .showsCameraControlls == YES . Happy days. However, when I set showsCameraControlls to NO , and supply my own (which in turn triggers takePicture method), the volume-up button will no longer work. How can I detect the volume event while the UIImagePickerController is showing? The old way to detect volume changes was like so: AudioSessionSetActive(true); [

UIImageView not showing transparency of PNG Images from UIImagePickerController

非 Y 不嫁゛ 提交于 2019-11-28 01:59:32
I surely hope I am missing something because I do not understand why this is working the way it does. I have a PNG Image, which has a fully transparent background because I want to overlay it on other images inside a UIImageView . PNG images included in the XCode project all work fine as they should. The problem is when I select these same PNG images on the fly using UIImagePickerController and then assigning it to the UIImageView , for some really bizarre reason, it is not respecting it as a PNG Image with transparency and instead it adding a white background. Anyone seen this before and how

UIImagePickerController in Swift 3

自作多情 提交于 2019-11-28 01:57:43
I've recently updated to Swift 3 in Xcode 8 using the developer beta. I'm trying to implement Firebase Auth, and everything's going well. My Problem: I'm trying to upload an image as a user's profile picture to a Firebase database. I thought I could use the UIImagePickerController to do this, but when I do, I get a "Thread 7: Signal SIGABRT I know what this would normally indicate, but I checked, and my image does indeed print my test statement when I tap it. My failed method: ViewController.swift import UIKit import Firebase import Photos class ViewController: UIViewController,

iOS 10 - App crashes To access photo library or device camera via UIImagePickerController

亡梦爱人 提交于 2019-11-28 00:28:18
Below is my code to access photo library -(void)click_gallery { if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) { UIImagePickerController *imgPicker= [[UIImagePickerController alloc] init]; UIColor* color = [UIColor colorWithRed:46.0/255 green:127.0/255 blue:244.0/255 alpha:1]; [imgPicker.navigationBar setTintColor:color]; imgPicker.delegate = self; imgPicker.allowsEditing = YES; imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentViewController:imgPicker animated:NO completion:Nil]; } } And it aborts with This

How to get file name in uiimagepickercontroller with Asset library?

五迷三道 提交于 2019-11-28 00:09:47
I want to get the file name from UIImagepickercontroller .I do not want to use ALAssetLibrary because it is deperecated in iOS 9.Please tell how to use it.I have used below code but it return me imagename as Asset.jpg always for each file. func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { let originalImage = (info[UIImagePickerControllerOriginalImage] as? UIImage)! let url = info[UIImagePickerControllerReferenceURL] as! NSURL imageData = UIImageJPEGRepresentation(originalImage, 100) as NSData? let data = UploadData() data

Image size taken from Flutter Image_Picker plugin is way too big

随声附和 提交于 2019-11-28 00:08:40
问题 I want to use auto-focus on the camera, which is available on the image_picker plugin. However, when I call: var bytes = new File(imagePath); var enc = await bytes.readAsBytes(); print(enc.length); I got: 5121126 which takes at least 10 seconds when I want to encode into json to send to an API server: var body = json.encode({ 'image' : enc }) In contrast, with the camera plugin, my byte array is only 420685, which is 10 times smaller, but it doesn't have the auto-focus feature. Can I get some

Swift 4.2 Cannot convert value of type '(UIImagePickerController.InfoKey).Type' to expected argument type 'UIImagePickerController.InfoKey'

谁说胖子不能爱 提交于 2019-11-27 23:35:25
问题 My below code was working just fine with swift 4 but after upgrading to swift 4.2 I am getting this error, I had wasted my 3 hours searching what's the issue but failed. Please if anyone can guide me how to fix this. func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey : Any]) { if postType == 2 { let image = info[convertFromUIImagePickerControllerInfoKey(UIImagePickerController.InfoKey)] as! UIImage mediaType.image

Storing a reference to an image saved in the Camera Roll

谁都会走 提交于 2019-11-27 23:11:51
问题 I've been working on a simple application which allows the user to take a photo and store it in the camera roll for later use. To do this, I am using a UIImagePickerController, and the method UIImageWriteToSavedPhotosAlbum, which is working perfectly. My question is: Is there any way to store the path to the image in the Camera Roll so that I can use that to call the image again later? Or, do I have to save the image in the app in order to use it again later? It would be great if there was a