I am working on a document viewer to display company documents scanned in as Tiffs and the meta data associated with each document and need assistance with how to display the image correctly in the viewer. I created an application page in SharePoint with a table and I added a menu into the ECB in the document library so when the ImageViewer is selected it opens the page and passes the list and item IDs on the query string to the page. I can display the index data but I can't find anything that I can easly plug into the page to display the Tiff. I am currently using the ASP Image object from the Visual Studio 2008 toolbox and have found some suggestions that I can convert the Tiff to Jpeg using "Image myImage = Image.FromFile(fileName), myImage.save(outFileName, ImageFormat.Jpeg) from the System.Drawing namespace and then display the Jpeg, but I haven't been able to get the syntax correct to convert it and then wire it up to the asp:image object's ImageURL so it will display when the page renders. I would appreciate any assistance with this and I am open to other methods to do it but I don't have a budget to purchase any addins and I don't have a lot of time to practive so any explicit examples would be extremely helpful.
Thank you in advance.
System.Drawing namespace would convert TIFF to JPEG only if you call Image.S ave Method (http://msdn.microsoft.com/en-us/library/9t4syfhh.aspx) .
You can display the tiff image using Through ImageDraw's DrawImage method.
Tiff image is bitonal image. All drawing in .NET requires a Graphics object, but a Graphics object cannot be created from a bitonal image.
Therefore, The .NET framework does not support modifying bitonal (i.e. single bit per pixel) images.
You may want convert the bitional image to other format before modifying it. Visit this site to understand more on how to write a image converter for tiff image.
You may download the sample code that demonstrates loading and converting a bitonal image to an RGB image for modification and demonstrates a method for converting the RGB image back into a bitonal image so that it can be saved back to disk.
Cogito, ergo sum.
- Marked as answer by Aaron Han - MSFT Friday, March 12, 2010 6:04 AM