iOS获取手机里的照片
来源:互联网 发布:玻璃幕墙设计软件 编辑:程序博客网 时间:2024/06/11 04:06
ALAssetsLibrary *library = [[ALAssetsLibraryalloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotosusingBlock:^(ALAssetsGroup *group,BOOL *stop) {
if(group != nil){
[groupenumerateAssetsUsingBlock:^(ALAsset *result,NSUInteger index, BOOL *stop) {
if(result != nil){
//获取资源的类型
NSString *type = [result valueForProperty:ALAssetPropertyType];
if([type isEqualToString:ALAssetTypePhoto]){//照片
//获取缩略图
CGImageRef thumbCGImage = [result thumbnail];
UIImage *thumImage = [UIImageimageWithCGImage:thumbCGImage];
//获取原图
ALAssetRepresentation *representation = [resultdefaultRepresentation];
CGImageRef fullCGImage = [representation fullResolutionImage];
UIImage *fullImage = [UIImageimageWithCGImage:fullCGImage];
}elseif([type isEqualToString:ALAssetTypeVideo]){//视频
ALAssetRepresentation *representation = [resultdefaultRepresentation];
NSURL *url = [representation url];
//播放视频
}
}
}];
}
}failureBlock:^(NSError *error) {
NSLog(@"遍历错误");
}];
- iOS获取手机里的照片
- IOS获取系统相簿里的照片
- 手机里的照片
- iOS---如何获取手机的本地照片和相册
- IOS开发获取手机内照片属性
- 手机里的照片没了怎么办
- Android,一个猥琐的获取妹子手机相机里所有照片的办法...
- IOS开发 获取手机里的全部图片
- 获取手机照片
- 获取手机照片UIImagePickerViewController
- 联想手机里的照片误删怎么恢复
- 手机里的照片被删除了怎么办
- 怎么恢复丨手机里的被丢照片呢
- 手机里的照片删了怎么恢复
- 三星手机里的照片删了怎么恢复
- 苹果手机里的照片删了怎么恢复
- 怎么免费恢复手机里删除的照片呢?
- 手机相机里的照片被误删了,如何恢复
- UIViewController的生命周期及iOS程序执行顺序
- BZOJ 1009: [HNOI2008]GT考试 AC自动机+矩阵快速幂
- android:SharedPreferences(参数)
- 3.驱动程序结构
- Android面试题整理(selfmade)——坚持每天回答一个
- iOS获取手机里的照片
- 【C++】探究类派生时构造函数的顺序
- 【UML】学习笔记(2)——用例图
- 4.设备注册和初始化
- UIViewContrller之间切换的几种方式
- Time Data
- HDU2066
- PHP学习笔记
- Java Socket编程