Generic Error In GDI+
-
I am writing an image resizing program, but I every time I try to save an image I get an error saying "Generic Error In GDI+". I've tried running my app on 3 different computers (2 desktops and 1 laptop all with WinXP and .NET 2.0), and the error only occurs on the laptop. I've looked everywhere for someone with a similar problem, and either it's something irrelevant or no one got an answer. What's going on?
Dim InitialImage As Bitmap = New Bitmap(OpenLocation)
Dim SetImage As Bitmap
SetImage = New Bitmap(InitialImage, New Size(WidthInt, HeightInt))
SetImage.Save(PathName, System.Drawing.Imaging.ImageFormat.Jpeg)Thanks for the help!
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
-
I am writing an image resizing program, but I every time I try to save an image I get an error saying "Generic Error In GDI+". I've tried running my app on 3 different computers (2 desktops and 1 laptop all with WinXP and .NET 2.0), and the error only occurs on the laptop. I've looked everywhere for someone with a similar problem, and either it's something irrelevant or no one got an answer. What's going on?
Dim InitialImage As Bitmap = New Bitmap(OpenLocation)
Dim SetImage As Bitmap
SetImage = New Bitmap(InitialImage, New Size(WidthInt, HeightInt))
SetImage.Save(PathName, System.Drawing.Imaging.ImageFormat.Jpeg)Thanks for the help!
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
Apparently from ASP.Net you will get this error when you are using a file path as a string. If this does not solve your problem then look at security issues in the Laptop. The ASPNET useraccount may not have permissions to write to disk.
Regards, Satips.
-
Apparently from ASP.Net you will get this error when you are using a file path as a string. If this does not solve your problem then look at security issues in the Laptop. The ASPNET useraccount may not have permissions to write to disk.
Regards, Satips.
Neither of these helped. The account on the laptop has write privileges. Any other ideas? Thanks.
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
-
Neither of these helped. The account on the laptop has write privileges. Any other ideas? Thanks.
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
Yea, I ran into this problem too...this should help...save using the encoder...if it returns nothing...then you will need to use a default encoder...like for a bitmap or something. Private Shared Function FindImageEncoder(ByVal theImg As Image) As ImageCodecInfo For Each info As ImageCodecInfo In ImageCodecInfo.GetImageEncoders If info.FormatID.Equals(theImg.RawFormat.Guid) Then Return info Next info Return Nothing End Function
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
-
Yea, I ran into this problem too...this should help...save using the encoder...if it returns nothing...then you will need to use a default encoder...like for a bitmap or something. Private Shared Function FindImageEncoder(ByVal theImg As Image) As ImageCodecInfo For Each info As ImageCodecInfo In ImageCodecInfo.GetImageEncoders If info.FormatID.Equals(theImg.RawFormat.Guid) Then Return info Next info Return Nothing End Function
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
Thanks a lot!
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
-
Thanks a lot!
Trinity: Neo... nobody has ever done this before. Neo: That's why it's going to work.
Any time, hope it helps, if not let me know.
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so