How to display .tiff images in iphone?

后端 未结 2 1001
南笙
南笙 2021-01-29 07:10

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

相关标签:
2条回答
  • 2021-01-29 07:18

    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

    0 讨论(0)
  • 2021-01-29 07:41

    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 讨论(0)
提交回复
热议问题