enum {
UIImagePickerControllerSourceTypePhotoLibrary ,//来自图库
UIImagePickerControllerSourceTypeCamera ,//来自相机
UIImagePickerControllerSourceTypeSavedPhotosAlbum //来自相册
};
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
NSLog(@"支持相机");
}
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary])
{
NSLog(@"支持图库");
}
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeSavedPhotosAlbum])
{
NSLog(@"支持相片库");
}
- (void)viewDidLoad {
[super viewDidLoad];
picker = [[UIImagePickerController alloc]init];
picker.view.backgroundColor = [UIColor orangeColor];
UIImagePickerControllerSourceType sourcheType = UIImagePickerControllerSourceTypeCamera;
picker.sourceType = sourcheType;
picker.delegate = self;
picker.allowsEditing = YES;
}
[self presentViewController:picker animated:YES completion:nil];
UIImagePickerControllerDelegate
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info;
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker;
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info;
NSString *const UIImagePickerControllerMediaType ;指定用户选择的媒体类型(文章最后进行扩展) NSString *const UIImagePickerControllerOriginalImage ;原始图片 NSString *const UIImagePickerControllerEditedImage ;修改后的图片 NSString *const UIImagePickerControllerCropRect ;裁剪尺寸 NSString *const UIImagePickerControllerMediaURL ;媒体的URL NSString *const UIImagePickerControllerReferenceURL ;原件的URL NSString *const UIImagePickerControllerMediaMetadata;当来数据来源是照相机的时候这个值才有效
const CFStringRef kUTTypeImage ;抽象的图片类型 const CFStringRef kUTTypeJPEG ; const CFStringRef kUTTypeJPEG2000 ; const CFStringRef kUTTypeTIFF ; const CFStringRef kUTTypePICT ; const CFStringRef kUTTypeGIF ; const CFStringRef kUTTypePNG ; const CFStringRef kUTTypeQuickTimeImage ; const CFStringRef kUTTypeAppleICNS const CFStringRef kUTTypeBMP; const CFStringRef kUTTypeICO;
const CFStringRef kUTTypeAudiovisualContent ;抽象的声音视频 const CFStringRef kUTTypeMovie ;抽象的媒体格式(声音和视频) const CFStringRef kUTTypeVideo ;只有视频没有声音 const CFStringRef kUTTypeAudio ;只有声音没有视频 const CFStringRef kUTTypeQuickTimeMovie ; const CFStringRef kUTTypeMPEG ; const CFStringRef kUTTypeMPEG4 ; const CFStringRef kUTTypeMP3 ; const CFStringRef kUTTypeMPEG4Audio ; const CFStringRef kUTTypeAppleProtectedMPEG4Audio;
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有