Hello Stefan,
Thanks for posting in the group.
After reviewing the problem description carefully, I think the exception should happen at line:
b.SelectActiveF rame(frameDim,i ntFrame);
If you transfer a >0 paramter to intFrame, the exception happens, right?
If so, it is related to GDI+ issue, not asp.net. I think you could create a simple windows form application and paste the same
code to see whether you could repro the problem or not. My suggestion for you is to post this question in framework.drawi ng
group. The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and
other partners who the newsgroups regularly can either share their knowledge or learn from your interaction with us.
When posting, it is better if you provide the following informatin:
1) Which OS? If windoes XP, please install windows XP SP1 first.
2) Which version of .NET framework are you using?
3) Could you use fax viewer to view all the pages of that TIff file successfully?
Thanks.
Best regards,
Yanhong Huang
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
!From: "SF" <st************ ****@captaris.c om>
!Subject: Multipage Tif viewer
!Date: Thu, 14 Aug 2003 13:09:19 -0700
!Lines: 49
!X-Priority: 3
!X-MSMail-Priority: Normal
!X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
!X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
!Message-ID: <Oe************ **@TK2MSFTNGP09 .phx.gbl>
!Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
!NNTP-Posting-Host: mx1.captaris.co m 12.129.11.151
!Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
!Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1680 51
!X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
!
!Folks,
!
!I've been running into problems with a multipage Tif viewer that I wrote to
!display fax images in an ASP.Net app. I've been basically following the
!standard examples on how to do this:
!
!- Read the image from a file
!- set the current frame
!- write the frame data to an output stream
!
! and ended up with this code:
!
!<snip>
! System.Drawing. Image b;
! System.Drawing. Imaging.FrameDi mension frameDim;
!
! //Read Tif from file (todo: change fromFile to stream)
! strFilename = ConfigurationSe ttings.AppSetti ngs["Images.Dir "] +
!Request["filename"];
! b = System.Drawing. Image.FromFile( strFilename);
!
! //Set current frame
! frameDim = new
!System.Drawing .Imaging.FrameD imension(b.Fram eDimensionsList[0]);
! int intFrame = int.Parse(Reque st["frame"]);
! b.SelectActiveF rame(frameDim,i ntFrame);
!
! //Save to output stream in jpg format
! Response.Conten tType="image/jpeg";
! b.Save(Response .OutputStream,S ystem.Drawing.I maging.ImageFor mat.Jpeg);
! b.Dispose();
!</snip>
!
!Now, this code works fine with Group 4 Tiff files. However, I am dealing
!with Group 3 and here the application throws a "A generic error occurred in
!GDI+."-exception whenever intFrame>0 (basically I can view the first page
!and that's it). I saw other people in newsgroups having the same kind of
!roblem but it never got resolved. Is this a bug in System.Drawing. Image? Is
!there a patch or workaround for this?
!
!Any advice/suggestions/code samples greatly appreciated.
!Thanks
!-Stefan
!
!PS: If needed, I can supply an example Tif for both Group3/Group4 formats.
!
!
!
!
!