我正在使用UIImagePickerController来允许我的用户从资产库中选择一个视频.
当用户选择第二个屏幕上的"选择"按钮时,视图显示进度条和"压缩视频..."消息.
为什么会这样?
有什么办法可以避免这种压缩操作吗?
有没有人知道如何在相机模式下启用UIImagePickerController上的相册按钮?就像iphone上的相机应用程序如何在图像和视频拍摄之间切换一样,还有按钮来查看照片库?
当我尝试使用UIImagePickerController从XCode 5的iOS模拟器中的相机胶卷中选择视频时,我得到上述错误.这是输出:
2013-11-02 21:28:44.788 Imagepicker[89146:1403] 21:28:44.788 ERROR: 185: Error creating aggregate audio device: 'what'
2013-11-02 21:28:44.788 Imagepicker[89146:1403] 21:28:44.788 WARNING: 219: The input device is 0x32; 'AppleHDAEngineInput:1B,0,1,1:2'
2013-11-02 21:28:44.789 Imagepicker[89146:1403] 21:28:44.789 WARNING: 223: The output device is 0x28; 'AppleHDAEngineOutput:1B,0,1,2:0'
2013-11-02 21:28:44.790 Imagepicker[89146:1403] 21:28:44.790 ERROR: 398: error 'what'
2013-11-02 21:28:44.791 Imagepicker[89146:a0b] 21:28:44.791 ERROR: 398: error -66680
2013-11-02 21:28:44.791 Imagepicker[89146:a0b] 21:28:44.791 ERROR: 398: error -66680
2013-11-02 21:28:44.792 Imagepicker[89146:a0b] 21:28:44.792 ERROR: 398: error -66680
2013-11-02 21:28:44.792 Imagepicker[89146:a0b] 21:28:44.792 ERROR: 398: error -66680
Run Code Online (Sandbox Code Playgroud)
我的代码是:
imagePicker …Run Code Online (Sandbox Code Playgroud) 在这里,我正在使用IOS 7开发一个应用程序,其中相机用于捕获图像.但在捕获图像后,它会显示重拍/使用照片选项.我希望在捕获图像之后直接进入下一个屏幕而不显示默认重拍?使用照片选项.我谷歌这个问题,但我没有得到适当的解决方案.请帮我解决这个问题.
提前致谢.
这是我在项目中使用的代码片段

-(void)StartCamera
{
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Device has no camera" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
[myAlertView show];
}
else
{
picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentViewController:picker animated:YES completion:NULL];
}
}
Run Code Online (Sandbox Code Playgroud) 虽然在选择从图像拾取的图像iOS 10 Objective-C和Xcode 8.我收到一个错误 -
创建具有未知类型的图像格式是错误的
.
以前的版本没问题.
这是我的代码:
UIImagePickerController* imgPicker=[[UIImagePickerController alloc] init];
imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imgPicker.delegate = self;
[self presentViewController:imgPicker animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
和recive图像的委托方法是..
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissViewControllerAnimated:YES completion:NULL];
UIImage *myImage = [info objectForKey:UIImagePickerControllerOriginalImage];
}
Run Code Online (Sandbox Code Playgroud)
我也试过其他委托功能..
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info{
}
Run Code Online (Sandbox Code Playgroud)
但错误不会发生.
我不确定它是Xcode 8的错误吗?
如果任何人遇到问题并解决了请帮助解决它.
使用UIImagePickerController拍照后有没有办法禁用图像预览?我想在用户按下快门释放按钮后立即关闭ImagePicker.
我想弄清楚是否有任何方法来镜像图像.例如,拍摄某人脸部的照片,然后将其切成两半,并显示每个镜像的脸部样子.在CGAffineTransform函数中似乎没有这样的技巧.图形专家请帮忙!!!
如果你使用pushViewController来推送UIImagePickerController
[self.navigationController pushViewController:pvc animated:YES];
Run Code Online (Sandbox Code Playgroud)
你会得到错误的
不支持推送导航控制器
正确的解决方案是使用presentModalViewController
[self presentModalViewController:pvc animated:YES];
Run Code Online (Sandbox Code Playgroud)
那么这个案子的深层原因是什么?UIViewController中隐藏了什么?
谢谢
uiimagepickercontroller pushviewcontroller presentmodalviewcontroller ios
我已经能够完成我想要完成的任务,那就是复制iOS内置的圆形照片裁剪器,用于内置的联系人应用程序.但是,我一直在试图让我的CAShapeLayers制作正确.我正在尝试制作一个透明的320像素直径圆圈,其余部分则填充0.9 alpha黑色背景.圆形和矩形在正确的位置,但是,圆形并不像我需要的那样完全透明.
我迷失了如何解决这个问题.我感谢您的帮助!代码和截图:
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
if ([navigationController.viewControllers count] == 3)
{
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenHeight = screenRect.size.height;
UIView *plCropOverlay = [[[viewController.view.subviews objectAtIndex:1]subviews] objectAtIndex:0];
plCropOverlay.hidden = YES;
CAShapeLayer *circleLayer = [CAShapeLayer layer];
if (screenHeight == 568)
{
[circleLayer setPosition:CGPointMake(0.0f,124.0f)];
}
else
{
[circleLayer setPosition:CGPointMake(0.0f,80.0f)];
}
UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:
CGRectMake(0.0f, 0.0f, 320.0f, 320.0f)];
[circleLayer setPath:[path CGPath]];
[circleLayer setFillColor:[[UIColor whiteColor] CGColor]];
circleLayer.opacity = 0.7f;
// Set to 0.7f to show …Run Code Online (Sandbox Code Playgroud) 我正在使用UIImagePickerController来拍摄和编辑图片.它在风景中工作得很好,但在肖像中它会将图片裁剪成正方形(不允许缩小图像以完全适合方形裁剪场,如在风景中.任何想法?
码:
-(IBAction)initCamera:(id)sender{
//Init imagePicker instance
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
[imagePicker setDelegate:self];
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
[imagePicker setShowsCameraControls:YES];
[imagePicker setAllowsEditing:YES];
[self presentModalViewController:imagePicker animated:YES];
[imagePicker release];
}
Run Code Online (Sandbox Code Playgroud)