By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,402 Members | 1,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,402 IT Pros & Developers. It's quick & easy.

Display tiff images

P: n/a
Hi All,

In my application, I have to display tiff images
stored on server. Please help me in acheaving this.

With Regards,
Mustaq Ahmed.A

Oct 5 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Oct 5, 9:01 am, "a.mus...@gmail.com" <a.mus...@gmail.comwrote:
Hi All,

In my application, I have to display tiff images
stored on server. Please help me in acheaving this.

With Regards,
Mustaq Ahmed.A
Here's a sample script that will work as showimage.aspx?
image=file.tiff, where file.tiff is a name of the file in the root

<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(Object sender, EventArgs e)
{
string imageLocation = Server.MapPath(Request.QueryString["image"]);
System.Drawing.Bitmap origBitmap = new
System.Drawing.Bitmap(imageLocation);
System.Drawing.Bitmap outputImage = new
System.Drawing.Bitmap(origBitmap);
System.Drawing.Imaging.ImageFormat outputFormat =
System.Drawing.Imaging.ImageFormat.Jpeg;
outputImage.Save(Response.OutputStream, outputFormat);
outputImage.Dispose();
origBitmap.Dispose();
}
</script>

as you can see it converts an image into Jpeg. Note, that the
System.Drawing.Bitmap object has a problem to load some TIF files.
Some work and some don't ("Parameter is not valid" error is thrown).
As I see it can be a problem of the format. For example, for files
with no compression, or in LZW it would work, and ZIP is not working.

Hope it helps

Oct 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.