PlayKid
PlayKid

Reputation: 1375

How do I display tiff files on Silverlight?

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

Upvotes: 7

Views: 6731

Answers (5)

Rap
Rap

Reputation: 7292

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

Upvotes: 1

herzmeister
herzmeister

Reputation: 11297

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.

Upvotes: 7

Jon Galloway
Jon Galloway

Reputation: 53155

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.

Upvotes: 0

Joseph
Joseph

Reputation: 25533

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.

Upvotes: 0

AnthonyWJones
AnthonyWJones

Reputation: 189555

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.

Upvotes: 0

Related Questions