图像的路径和扩展 [英] Path and extension of image

查看:53
本文介绍了图像的路径和扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从iPhone设备获取相册图像的路径a.而且我还需要使用该图像的名称作为扩展名.

I want to get the Path a of image of the photo 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);

这篇关于图像的路径和扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆