草庐IT

UIImagepickercontroller

全部标签

ios - UIImageView 不显示来自 UIImagePickerController 的 PNG 图像的透明度

我当然希望我遗漏了一些东西,因为我不明白为什么它会这样工作。我有一个PNG图像,它具有完全透明的背景,因为我想将它覆盖在UIImageView中的其他图像上。XCode项目中包含的PNG图像都可以正常工作。问题是,当我使用UIImagePickerController即时选择这些相同的PNG图像,然后将其分配给UIImageView时,出于某些非常奇怪的原因,它没有将其视为具有透明度的PNG图像,而不是添加白色背景。有人以前见过这个吗?我该如何解决这个问题?*更新#1:我决定尝试一些似乎可以证实我的理论的东西。我决定通过电子邮件将我保存到设备中的原始PNG图片发送给自己,你瞧,这些图片

ios - 摄像头下方有一个黑色的底部空间

我从UITabBarController呈现一个UIImagePickerController。letimagePicker=UIImagePickerController()imagePicker.delegate=selfimagePicker.sourceType=.CameraimagePicker.allowsEditing=falseimagePicker.showsCameraControls=falsepresentViewController(imagePicker,animated:true,completion:nil)我已明确将showsCameraContro

ios - 如何使用 UIImagePickerControllerDelegate 在 vi​​ewDidLoad 上启动相机?

我在Swift中有一个新的iOS应用程序,我试图在应用程序启动后立即显示相机。在我的ViewController中,我有一个UIView对象,我尝试用相机填充它。我的ViewController中的代码在viewDidLoad方法中调用了UIImagePickerController但没有任何反应。这是代码,知道为什么没有任何反应吗?相机不应该使用此代码在应用启动时打开吗?importUIKitclassViewController:UIViewController,UINavigationControllerDelegate,UIImagePickerControllerDelega

ios - 在自定义图像选择器覆盖上执行 "use photo"按钮

我正在为图像选择器Controller创建完全自定义的叠加层。第一阶段很简单:我通过调用takePicture()方法的录制/拍摄按钮获得第一个View。下一阶段是将UI更改为“Retake”或“Usephoto”,这也是我自己设计的。“Retake”可能可以通过再次调用presentViewController来模仿。我应该如何模仿“使用照片”按钮? 最佳答案 可以轻松继承UIImagePickerControllerobjective-C@interfaceCameraViewController:UIImagePickerCo

swift - 如何在 Swift 中从 UIImagePickerController 获取编辑后的图像?

我看过并阅读了documentsofApple他们在哪里明确提到了关键UIImagePickerControllerEditedImage.但是当我运行下面的代码时,我没有在字典中得到那个键。这背后的原因是什么?我的代码:funcimagePickerController(picker:UIImagePickerController!,didFinishPickingMediaWithInfoinfo:NSDictionary!){println(info)//vartempImage:UIImage=info[UIImagePickerControllerOriginalImage]

ios - 照片框架 : save exif data from picker (aperture, 焦距,快门速度,...)

我正在尝试使用新的照片框架执行与writeImageToSavedPhotosAlbum等效的操作。为了保存图像,我只这样做:funcimagePickerController(picker:UIImagePickerController,didFinishPickingMediaWithInfoinfo:[NSObject:AnyObject]){letimage=info[UIImagePickerControllerOriginalImage]asUIImagePHPhotoLibrary.sharedPhotoLibrary().performChanges({()->Void

ios - UIImagePickerControllerDelegate 从 iOS 11 中选取的图像获取日期

UIImagePickerControllerReferenceURL在iOS11中被弃用(尽管它仍然在info字典中返回)并且应该被替换为UIImagePickerControllerPHAsset,但我还没有得到包含该键的info字典。由于一个已弃用而另一个已丢失,是否有已知的解决方案可以从选取的图像中提取“拍摄日期”?作为引用,这是一个示例info字典,当从库中选取图像时返回该字典:▿4elements▿0:2elements-key:"UIImagePickerControllerImageURL"-value:file:///private/var/mobile/Contai

ios - UIImagePickerController: didFinishPickingMediaWithInfo 未被调用

希望你们一切都好。想知道是否有人可以帮助我理解为什么Xcode不能很好地配合我....我已将代码分解为以下部分,以便允许我从UIImagePicker中选择个人资料照片:WORKS:为ImagePicker和NavigationController分配委托(delegate)类工作:实例化UIImagePicker变量WORKS:加载ImagePickerViewController并启用选择图像失败:添加了用于使用UIImagePicker关闭和完成拾取的附加函数,但都没有被调用?我做错了什么?提前致谢!classProfileVC:UIViewController,UIImageP

ios - Swift 3.0 获取从 UIImagePickerController 中选择的 UIImage 的 URL

注意:-此问题仅适用于Swift3.0我能够获得Swift3.0的路径prio我想在didFinishPickingMediaWithInfo方法中选择UIImage的路径letimageUrl=info[UIImagePickerControllerReferenceURL]as?NSURLletimageName=imageUrl.lastPathComponentletdocumentDirectory=NSSearchPathForDirectoriesInDomains(.documentDirectory,.userDomainMask,true).first!letpho

ios - UIImagePickerController & View 不在窗口层次结构中

我有一个简单的Swift项目,其中:ViewControllerA(classViewController:UIViewController)呈现ViewControllerB--(classWebViewController:UIViewController,WKNavigationDelegate,CLLocationManagerDelegate,WKScriptMessageHandler).ViewControllerB本质上只是一个WKWebView,这是它的viewDidLoad():letcontentController=WKUserContentController