Gdi Error On Website
Contents |
here for a quick overview of the site Help Center Detailed answers to a generic error occurred in gdi c# image save any questions you might have Meta Discuss the workings and
A Generic Error Occurred In Gdi+. Bitmap.save C#
policies of this site About Us Learn more about Stack Overflow the company Business Learn system.runtime.interopservices.externalexception (0x80004005): a generic error occurred in gdi+. more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community
How To Solve A Generic Error Occurred In Gdi+
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up asp.net : A generic error occurred in GDI+ up vote 1 down vote favorite 5 I create an asp.net 4.0 web application which has a web service a generic error occurred in gdi in c# windows application for uploading images. I am uploading images by sending the image in form of Base64 string from my mobile app to the web service. Following is my code: public string Authenticate(string username, string password, string fileID, string imageData) { Dictionary
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/Retired Forums/nGallery (RETIRED)/A generic error
System.runtime.interopservices.externalexception: A Generic Error Occurred In Gdi+.
occurred in GDI+ A generic error occurred in GDI+
A Generic Error Occurred In Gdi+ Windows 7
RSS 14 replies Last post Sep 15, 2011 02:12 AM by savindra.bandi ‹ a generic error occured in gdi+. bitmap.save c# Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Reply jimmyLeander None http://stackoverflow.com/questions/7698737/asp-net-a-generic-error-occurred-in-gdi 0 Points 3 Posts A generic error occurred in GDI+ Jul 04, 2004 05:50 PM|jimmyLeander|LINK I received the foolowing message when attempting to upload a message. I do not have any .Net experience. Is there anyone out there that will take the time to give me http://forums.asp.net/t/624305.aspx?A+generic+error+occurred+in+GDI+ a hand with this .Net error message? This appears to be a really nice looking and funtional image gallery and I would really enjoy using for family photos. Jimmy......................................................... A generic error occurred in GDI+. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: -------------------------------------------------------------------------------- [ExternalException (0x80004005): A generic error occurred in GDI+.] System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) +582 nGallery.Lib.PhotoCache.GetScaledPicture() +1747 nGallery.Lib.PhotoCache.GetThumbnail() +66 nGallery.admin.addPicture.btnSubmit_ServerClick(Object sender, EventArgs e) &
ASP.NET|Source Code Sponsored By I got a nice little Yellow Screen of Death (YSOD) error on some code running under IIS that worked fine when running http://www.hanselman.com/blog/TheWeeklySourceCode50ALittleOnAGenericErrorOccurredInGDIAndTroubleGeneratingImagesOnWithASPNET.aspx on the VS Developer Web Server. The error was "A generic error occurred in GDI+" and you know that if an error is generic, it's sure in the heck not specific. My little application takes an overhead map that's stored in a local file, does some calculations from user input and draws an X on the map, then returns the resulting dynamically generated image. There's basically a generic three ways to do images on the server side. Use Native APIs and Interop, which only works in full trust, use System.Drawing, which "isn't supported" or use WPF on the server side, which also, ahem, isn't officially supported. I'm still trying to figure out why, but just to be clear, I used System.Drawing in extremely high traffic sites with no problems. As long as paid close attention a generic error to my unmanaged resources, I have never had a problem. I've heard anecdotally of people having trouble with GDI+ (System.Drawing) and switching over to WPF and having no problem with that. As with all things, test what you're doing. There's even some ASP.NET Controls on CodePlex that might help. Now this post can't answer ALL reasons you're getting "a generic error occurred in GDI+" but it can answer mine. In my particular case (and I think this is the most common mistake) I was saving the composited image as a PNG. First, I'll show you a little chunk of a code from 5 years ago that took two images and built a single image from them. public class SomeCheckImageHandler : IHttpHandler{ //some stuff snipped public SomeCheckImageHandler(){} public void ProcessRequest(HttpContext context) { context.Response.ContentType = "image/jpg"; //some stuff snipped GetCheckImageRequest req = new GetCheckImageRequest(); //some stuff snipped, get the params from the QueryString GetCheckImageResponse res = banking.GetCheckImage(req); //some stuff snipped if (res.ImageBack != null) { //merge them into one image using(MemoryStream m = new MemoryStream(res.BackImageBytes)) using(Image backImage = System.Drawing.Image.FromStream(m)) using(MemoryStream m2 = new MemoryStream(res.BrontImageBytes)) using(Image frontImage = System.Drawing.Image.FromStream(m2)) using(Bitmap compositeImage = new Bitmap(frontImage.Width,frontImage.Height+backImage.Height)) using(Graphics compositeGraphics = Graphics.FromImage(compositeImage)) { compositeGraphics.Com