开发者

How to display .tiff images in iphone?

I want to display .tiff images coming from server in my native iphone application. Is it possible t开发者_StackOverflow中文版o display .tiff images in native iphone application? I am trying to solve this problem since 2 hrs with no success. I searched the net for nearly 2 hrs with no solution to this problem.

Can anyone help me to solve this problem...

Any sample code will be very helpful...

Thanx in advance...


Here it says that the tiff format is supported by the UIImage class so you can load it in one of those and put it into an UIImageView. Have you already tried this? If the answer is yes, post some code


Yes. You can display tiff images coming from the server. You can load these images into WebView or UIImageView. What you need to do is :

You need to encode the data which comes from the server.After encoding the data, you need to add it inside the WebView. Example :

NSMutableData *recievedData; // the data coming from the server

......

NSString *str = [receivedData base64Encoding]; //my base64Encoding function

NSData *new_data = [NSData dataWithBase64EncodedString:str]; my function

UIImage *image2 = [UIImage imageWithData:new_data];

[image_view setImage:image2];

[web_view loadData:new_data MIMEType:@"image.tiff" textEncodingName:nil baseURL:nil];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜