アットウィキロゴ

UIImageを保存

// JPG保存
NSData *data = [[NSData alloc] initWithData:UIImageJPEGRepresentation(image,0.8)];
NSString *filePath = [NSString stringWithFormat:@"%@/test.jpg" , [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]];
[data writeToFile:filePath atomically:YES];
 
// TIF保存
NSString *filePath = [NSString stringWithFormat:@"%@/test.tif" , [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]];
[[image TIFFRepresentation] writeToFile:filePath atomically:YES];
 
// PNG保存
NSString *filePath = [NSString stringWithFormat:@"%@/test.png" , [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]];
NSData *data = UIImagePNGRepresentation(image); 
[data writeToFile:filePath atomically:YES];

タグ:

+ タグ編集
  • タグ:
最終更新:2012年09月11日 10:52
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。