How can I break up a large tif file into multiple UIImage's for display in a UIImageView?
I am consuming a web service that is returning electronic faxes in the form of tif (base 64 encoded text). The thing is it is returning multi-page faxes as one large tiff 开发者_Go百科file and ideally I want the user to be able to click through the various pages. When I decode the text and display, it only shows the first page in the UIImageView.
Can someone point me in the right direction?
I've create my own solution for this: NSTiffSplitter. You can find it on github.
NSString *pathToImage = [[NSBundle mainBundle] pathForResource:@"Example" ofType:@"tiff"];
NSTiffSplitter* splitter = [[NSTiffSplitter alloc] initWithPathToImage:pathToImage];
UIImage *page = [[UIImage alloc] initWithData:[splitter dataForImage:page]];
yourImageView.image = page;
[page release];
精彩评论