开发者

How to load and display local image in Three20

开发者_C百科Now I am on Three20.. I am using Two image source for loading image..That means

One Type of image from LOcal folder.ie from application folder Other is from url.. My problem is i dont know how to load image from local folder..and display it...

My code is given below...

 BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:mpngPath];
    if(fileExists==YES)
    {

        NSLog(@"image is present");

        //load and display??


    }


    else {
        NSLog(@"image is  not present");
              }


Like this:

[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"filename" ofType:@"png"]];


Replace the url with your photo path. I assume that you save your images in your document directory.

 [NSString stringWithFormat:@"documents://%@",yourPhotoName];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜