【发布时间】:2011-09-07 23:32:11
【问题描述】:
我有一些简单的代码,它从文档目录中提取图像......并将其加载到 imageView 中。
- (void)viewDidLoad
{
[super viewDidLoad];
NSString* pathToFile = [NSString stringWithFormat:@"%@/images/%@",[self documentsDirectory],@"copy.jpg"];
UIImageView *tmp = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:pathToFile]];
[self.view addSubview:tmp];
}
- (NSString *)documentsDirectory
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
return [paths objectAtIndex:0];
}
我的图像在查看时显示正确,但是当它加载到应用程序并在模拟器上查看时……它是倒置的。
示例:https://skitch.com/critz/fnh8p/colorsnapper
任何想法、建议..都会/非常/感激..
【问题讨论】:
-
不确定。你尝试过其他图片吗?
标签: objective-c image-processing uiimageview uiimage ios-simulator