473,503 Members | 12,003 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5025
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2682
by: Pohihihi | last post by:
I am getting a generic GDI+ error on following code. Basically it is trying to capture screen image and save in a file. Is there a way to find more details on this error? Thanks for the help. ...
7
7301
by: Philip Wagenaar | last post by:
I use a class to manage tiff's (written by someone else) to splitt multipage tiffs. However, when I run it, it fails, for other people it seems work ok. The method in the class is :public...
2
22279
by: Alphonse Giambrone | last post by:
I am currently reading 'Programming The Web with Visual Basic .NET' and have so far found it to be excellent. Downloaded all the code from Apress and working in chapter 4, I get the error shown...
13
4628
by: lgbjr | last post by:
Hello All, I have some pictureboxes on a VB.NET form that are linked to an AccessDB. If the user wishes to open or edit an image, I need to save the image in the picturebox to a temp file, then...
15
5300
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the...
0
3930
by: Robin van de Water [synthesiSFactory] | last post by:
Hi All, In one of my web applications, I intercepted the following error in the Application_Error part of the Global.Asax: GDI+ is not properly initialized (internal GDI+ error). The error...
0
1237
by: James Wong | last post by:
Hi everybody, I'm facing a serious trouble relating to GDI+ generic error. The error message is "A Generic error occured in GDI+" and the following information is stored in Excepton object:...
14
4091
by: James Wong | last post by:
Hi everybody, I'm facing a serious trouble relating to GDI+ generic error. The error message is "A Generic error occured in GDI+" and the following information is stored in Excepton object:...
0
7067
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.