ios 图片操作
2012-02-14 17:30
357 查看
http://stackoverflow.com/questions/3837115/display-image-from-url-retrieved-from-alasset-in-iphone display image from URL retrieved from ALAsset in iPhone
http://stackoverflow.com/questions/1282830/uiimagepickercontroller-uiimage-memory-and-more UIImagePickerController, UIImage, Memory and More? [closed]
/article/1563112.html IPad开发拍照并将图片保存到照片库中
http://stackoverflow.com/questions/1238838/uiimagepickercontroller-and-extracting-exif-data-from-existing-photos UIImagePickerController and extracting EXIF data from existing photos
1.把图片写入文件
2.从文件加载图片
3. uiimage大小
4.点击图片响应事件
http://stackoverflow.com/questions/1282830/uiimagepickercontroller-uiimage-memory-and-more UIImagePickerController, UIImage, Memory and More? [closed]
/article/1563112.html IPad开发拍照并将图片保存到照片库中
http://stackoverflow.com/questions/1238838/uiimagepickercontroller-and-extracting-exif-data-from-existing-photos UIImagePickerController and extracting EXIF data from existing photos
1.把图片写入文件
- (BOOL)writeImage:(UIImage*)image toFileAtPath:(NSString*)aPath { if ((image == nil) || (aPath == nil) || ([aPath isEqualToString:@""])) return NO; @try { NSData *imageData = nil; NSString *ext = [aPath pathExtension]; if ([ext isEqualToString:@"png"]) { imageData = UIImagePNGRepresentation(image); NSLog(@"png"); } else { NSLog(@"jpg"); // the rest, we write to jpeg // 0. best, 1. lost. about compress. imageData = UIImageJPEGRepresentation(image, 0); } if ((imageData == nil) || ([imageData length] <= 0)) return NO; [imageData writeToFile:aPath atomically:YES]; return YES; } @catch (NSException *e) { NSLog(@"create thumbnail exception."); } return NO; }
2.从文件加载图片
-(UIImage *)loadImageFromFile:(NSString *) aPath; { UIImage *im=[[UIImage alloc] initWithContentsOfFile:[self dataFilePath:aPath]]; if (im==nil) NSLog(@"nil %@",[self dataFilePath:aPath]); return im; }
3. uiimage大小
image.size.width,image.size.height
4.点击图片响应事件
resizedImageView.userInteractionEnabled = YES; UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(photoTapped)]; [resizedImageView addGestureRecognizer:singleTap];//点击图片事件 NSLog(@"haha"); [self.view addSubview:resizedImageView];//加载图片
相关文章推荐
- iOS图片实现可拉伸不变形的处理操作
- iOS中加载HTML数据,并点击图片或链接进行相应的操作
- IOS 图片加载过多导致内存警报的释放内存操作
- IOS-图片操作集合
- IOS:实现对图片的双击放大、移动、捏合操作
- iOS - 照片浏览器(图片放大,轮滑,长按操作)
- ios webview点击图片看大图效果及相应手势操作
- IOS中图片相关操作(读取、保存、绘制、其它相关)
- IOS-图片操作集合 待更新
- iOS中加载HTML数据,并点击图片或链接进行相应的操作
- iOS开发中图片的一些处理操作(背景色,透明度,合成,大小)
- iOS中在指定视图内进行代码截屏操作,并返回特定的图片
- [Objective C]iOS-图片操作集合
- 【学习ios之路:UI系列】修改图片的尺寸大小操作
- iOS 图片相关操作,如:翻转、缩放、截取等
- ios开发之--从相机或相册选取图片,并带删除操作的demo
- iOS绘图手势、图片裁剪、滚动效果、数据操作等源码
- iOS-图片拉伸,最常用的图片拉伸操作总结(干货)
- [IOS]网络操作+图片的下载和读取+json数据读取
- [iOS]手势操作实现图片的缩放