469,599 Members | 2,775 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,599 developers. It's quick & easy.

General GDI+ Error

..43Hi,

I am trying to extract tiff images from a multipage tiff and save them to
disk. This is becoming almost a nightmare for me. I have seen several
examples on the net that talk about this. For example :
http://www.codeproject.com/vb/net/faxeditor.asp THis example should work
great. But when I even try to load the multipage tiff that came with the
example I receive a general gdi+ error.

The same for a TIffManager Class written in c#. I also receive a general
GDI+ error with a totally diffrent multipage tiff.
http://www.codeproject.com/csharp/TiffManager.asp

I am trying this on a WIndows XP machine and a WIndows 2003 server. Both
have all updates installed (.net 1.1, sp's etc..) v1.1.4322.

What is going on here?
Nov 21 '05 #1
8 4866
Hi,

Here is an example which works fine on my machine. There is sample
code in vb.net and c#

http://www.bobpowell.net/addframes.htm

Ken
-------------------
"Philip Wagenaar" <ph*************@online.nospam> wrote in message
news:EA**********************************@microsof t.com...
.43Hi,

I am trying to extract tiff images from a multipage tiff and save them to
disk. This is becoming almost a nightmare for me. I have seen several
examples on the net that talk about this. For example :
http://www.codeproject.com/vb/net/faxeditor.asp THis example should work
great. But when I even try to load the multipage tiff that came with the
example I receive a general gdi+ error.

The same for a TIffManager Class written in c#. I also receive a general
GDI+ error with a totally diffrent multipage tiff.
http://www.codeproject.com/csharp/TiffManager.asp

I am trying this on a WIndows XP machine and a WIndows 2003 server. Both
have all updates installed (.net 1.1, sp's etc..) v1.1.4322.

What is going on here?

Nov 21 '05 #2
Hi,

I also tried that, that gives me an error on the line:

g.DrawImageUnscaled(bm, 0, 0)

in the doOpen sub.

It is a bufferoverflow error I believe.

"Ken Tucker [MVP]" wrote:
Hi,

Here is an example which works fine on my machine. There is sample
code in vb.net and c#

http://www.bobpowell.net/addframes.htm

Ken
-------------------
"Philip Wagenaar" <ph*************@online.nospam> wrote in message
news:EA**********************************@microsof t.com...
.43Hi,

I am trying to extract tiff images from a multipage tiff and save them to
disk. This is becoming almost a nightmare for me. I have seen several
examples on the net that talk about this. For example :
http://www.codeproject.com/vb/net/faxeditor.asp THis example should work
great. But when I even try to load the multipage tiff that came with the
example I receive a general gdi+ error.

The same for a TIffManager Class written in c#. I also receive a general
GDI+ error with a totally diffrent multipage tiff.
http://www.codeproject.com/csharp/TiffManager.asp

I am trying this on a WIndows XP machine and a WIndows 2003 server. Both
have all updates installed (.net 1.1, sp's etc..) v1.1.4322.

What is going on here?


Nov 21 '05 #3
Hi

I think that maybe caused by the GDI+ limitation.
So far .NET use GDI+ 1.0.

Here is a KB for you reference.
CAUSE
=====

This issue occurs because the improved Graphics Device Interface (GDI+) in
Windows XP provides less support to read TIFF image files that are
compressed in the JPEG format. In this scenario, the image file may not
open correctly.

885938 TIFF image files that are compressed in the JPEG format cannot be
http://support.microsoft.com/?id=885938

Please follow the steps above to have a test and let me know the result.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #4
Btw: I also have a gdi+ error with a C# application. A thread on this is
located at :

http://msdn.microsoft.com/newsgroups...b-9fcbf70803e6

The TIff image I am trying to splitt uses group 4 compression, this is
standard for fax software.

I tried the solution in the KB article, but it resulted in the same error.

""Peter Huang" [MSFT]" wrote:
Hi

I think that maybe caused by the GDI+ limitation.
So far .NET use GDI+ 1.0.

Here is a KB for you reference.
CAUSE
=====

This issue occurs because the improved Graphics Device Interface (GDI+) in
Windows XP provides less support to read TIFF image files that are
compressed in the JPEG format. In this scenario, the image file may not
open correctly.

885938 TIFF image files that are compressed in the JPEG format cannot be
http://support.microsoft.com/?id=885938

Please follow the steps above to have a test and let me know the result.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #5
Hi

Here is another KB aricle.
329270 You Cannot View TIFF Images Using Windows Picture and Fax Viewer
http://support.microsoft.com/?id=329270

So I think the problem may be caused by that the tiff format of your tiff
file is not supported by GDI+ which is included in .NET 1.1 so ar.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #6
I changed the encoding to LZW as explained in
http://support.microsoft.com/?id=885938

gdi+ supports the LZW encoding and it stills fails.

I viewed file properties using windows explorer and it shows that the width
and height are set, but the resolution is 0 by 0 for the file that gives the
error.

Does gdi+ need these to be set for it to work properly?
""Peter Huang" [MSFT]" wrote:
Hi

Here is another KB aricle.
329270 You Cannot View TIFF Images Using Windows Picture and Fax Viewer
http://support.microsoft.com/?id=329270

So I think the problem may be caused by that the tiff format of your tiff
file is not supported by GDI+ which is included in .NET 1.1 so ar.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #7
Hi Philip,

Can you view the tiff file with Windows Picture and Fax Viewer?
Because that tool use GDI+ 1.1, so if that can not open the tiff, I think
that may not support the format.

Microsoft Office 2003 has a Microsoft Office document imaging.
You may try to print the tiff file with a printer(document imaging) to see
if that works.
NOTE: by default that MODI may save it in jpeg format, you may try to
change it to LZW format.

Also .NET 1.1 use GDI+ 1.0, so that may have somewhat incompatible.

If you still have any concern, can you try to send me a copy your test tiff?
You may reach me via removing "online" from my email address.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #8
Hi Philip,

Based on my research, it seems there is something problem to paint the
frames in the tiff, but based on test, we can save it with the BMP format.
If you also need to show it, I think you may try to save it first and then
show that.

The code below is changed according to Ken's link.
http://www.bobpowell.net/addframes.htm

If bm.GetFrameCount(FrameDimension.Page) > 1 Then

Dim i As Integer

For i = 0 To (bm.GetFrameCount(FrameDimension.Page)) - 1

bm.SelectActiveFrame(FrameDimension.Page, i)
bm.Save("c:\test" & i.ToString() & ".bmp",
ImageFormat.Bmp) 'We can save it.
Dim temp As New Bitmap(bm.Width, bm.Height)

Dim g As Graphics = Graphics.FromImage(temp)

g.InterpolationMode = InterpolationMode.NearestNeighbor

'g.DrawImage(bm, 0, 0, 100, 100)

g.Dispose()

AddFrameToList(temp, -1)

Next i

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Pohihihi | last post: by
7 posts views Thread by Philip Wagenaar | last post: by
2 posts views Thread by Alphonse Giambrone | last post: by
reply views Thread by Robin van de Water [synthesiSFactory] | last post: by
reply views Thread by James Wong | last post: by
14 posts views Thread by James Wong | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.