How do I display tiff files on Silverlight?

馋奶兔 提交于 2019-11-30 04:06:26

问题


How do I display tiff files on a Silverlight application? I can display any image format except tiff, can anyone help me? Thanks.


回答1:


I was successful displaying TIFFs in Silverlight. It's easy to port the free LibTiff.NET library to Silverlight, just 3-4 minor tweaks required.

The library itself is quite legacy-like and raw to use and one still needs to have some knowledge about the inner workings of the TIFF format in order to be able to extract the image data the way one needs it.

But it's doable and the bits and pieces can then be chiseled into a WriteableBitmap.




回答2:


Why don't you try TiffLight? It is a Silverlight control that allows native display of Tiff files in Silverlight.




回答3:


A Tiff file is a multi-page format so rendering it is not as simple as a png, gif or bmp.

You have of course already found this via a web search but it'll cost you.




回答4:


Silverlight 2.0 doesn't support tiff images according to this.

However, in the article I believe it explains a way to convert the tiff image to a jpeg or a png (which is supported by Silverlight). However, you'll have to do this processing on the server-side.




回答5:


I would use an HttpHandler that converts the Tiff using the TiffBitmapDecoder and PngBitmapEncoder classes.

Alternatively, if you can decode the Tiff images in Silverlight, you can display them using a WriteableBitmap.



来源:https://stackoverflow.com/questions/1379392/how-do-i-display-tiff-files-on-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!