开发者

Inverted images in the simulator

开发者 https://www.devze.com 2023-03-10 11:38 出处:网络
I have a bit of simple code, that pulls images from the documents directory.. and loads it into an imageView.

I have a bit of simple code, that pulls images from the documents directory.. and loads it into an imageView.

- (void)viewDidLoad
{
    [super viewDidLoad];

    NSString* pathToFile = [NSString stringWithFormat:@"%@/images/%@",[self documentsDirectory],@"copy.jpg"];

    UIImageView *tmp = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:pathToFile]];

    [self.view addSubvie开发者_JAVA技巧w:tmp];
}



- (NSString *)documentsDirectory
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    return [paths objectAtIndex:0];
}

My image, when viewed shows up correct, but when it's loaded into the app and viewed on the simulator.. it's inverted.

Example: https://skitch.com/critz/fnh8p/colorsnapper

any ideas, suggestions.. would be /greatly/ appreciated..


Interesting... Same code base run in >4.2 and the images are inverted. If I run it in the 5bx simulator.. they come out as they should.. SMH. Oh well..

0

精彩评论

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