Re: Out of Memory Exception



Uou're right, and I realize this. In fact, I catch the exception if it
happens on the load and report an invalid file format..

In this case, as you can see from the stack trace, the OutOfMemoryException,
however, the exception is being thrown in
System.Drawing.Graphics.FromHDCInternal and is being triggered by a WM_PAINT
message, not an image load.

Pete

"Truong Hong Thi" <thi1981@xxxxxxxxx> wrote in message
news:1132290592.141500.36840@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi Pete,
>
>>I only instantiate the bitmaps that are visible at a given >time and
>>dispose
>>of them if they get scrolled out of view.
>
>>Still, somehow, I'm getting random errors in the painting >that I can only
>>assume is coming from some sort of GDI resource >issue.
>
> I also had to write code that generating thumbnails some time ago. .NET
> throws OutOfMemoryException if it does not recognize the image format.
> This happen for example when loading the image file whose format is
> unreconized/unsupported by .NET. Methods might raise this exception
> include Image.FromFile, Bitmap constructor, etc, see their "remark"
> section. You should debug your app to see if it is the cause.
>
> Regards,
> Thi
>
> Thi
>


.



Relevant Pages

  • Re: Load Testing Errors
    ... There are many reasons an application might fail under load when it normally ... I notice your exception is occurring inside a DataView. ... from your request when you were expecting non-null values. ... One is a "Object reference not set to an instance of an object." ...
    (microsoft.public.dotnet.framework.performance)
  • Re: Load Testing Errors
    ... There are many reasons an application might fail under load when it normally ... I notice your exception is occurring inside a DataView. ... from your request when you were expecting non-null values. ... One is a "Object reference not set to an instance of an object." ...
    (microsoft.public.dotnet.general)
  • Assmebly.Load error using Byte()
    ... I have 2 WebApplication project (dummy and dummy2). ... The first is trying to load a UserControl compiled in the second. ... The web sites are formed of a client part and an administration part. ... An unhandled exception occurred during compilation using ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: problem with XML DOM load command
    ... with invalid XML and I'm getting suspicious that something in a QFE ... has busted MSXML and its exception processing. ... © 2003 Microsoft Corporation. ... >> So this exception is on your main thread where you're doing the load. ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Load Testing Errors
    ... > There are many reasons an application might fail under load when it ... > I notice your exception is occurring inside a DataView. ... > from your request when you were expecting non-null values. ... >> System.Web.UI.DataBinder.GetPropertyValue(Object container, String ...
    (microsoft.public.dotnet.framework.performance)