Reputation: 5098
I want to display .tiff images coming from server in my native iphone application. Is it possible to 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...
Upvotes: 0
Views: 5810
Reputation: 21
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];
Upvotes: 1