views:

1627

answers:

4

Hi there,

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

A: 

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.

Joseph
A: 

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.

AnthonyWJones
+2  A: 

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.

Jon Galloway
+1 other "answers"(note the quotes) do not provide actual answers to the question but this one attempts to provide the answer to the question.
Sung Meister
+1  A: 

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.

herzmeister der welten
We just released LibTiff.Net 2.0 that natively supports Silverlight. There is Silverlight Test Application in source package that shows how to read the data bits of Tiff files and apply them to Silverlight's WriteableBitmap.
Bobrovsky