开发者

Path and extension of image

开发者 https://www.devze.com 2023-01-19 23:46 出处:网络
I want to get the Path a of image of the p开发者_如何学编程hoto albums from the iPhone device. and also i need the extension of that image with their name.newFilePath = [NSHomeDirectory()

I want to get the Path a of image of the p开发者_如何学编程hoto albums from the iPhone device. and also i need the extension of that image with their name.


newFilePath = [NSHomeDirectory() 
    stringByAppendingPathComponent: textFieldNormalFile_name.text];
//newFilePath = [NSTemporaryDirectory() stringByAppendingPathComponent: @"ChosenPic.jpg"];
imageData = UIImageJPEGRepresentation(img, 1.0);
if (imageData != nil) {
    NSLog(@"HERE [%@]", newFilePath);
    [imageData writeToFile:newFilePath atomically:YES];
}
image.image =[UIImage imageNamed:newFilePath];
NSLog(@"newFilePath:%@",newFilePath);
path.text =[NSString stringWithFormat:newFilePath];
NSLog(@"path.text :%@",path.text);
0

精彩评论

暂无评论...
验证码 换一张
取 消