Re: Out of Memory Exception
- From: "Pete Davis" <pdavis68@[nospam]hotmail.com>
- Date: Fri, 18 Nov 2005 07:41:59 -0600
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
>
.
- References:
- Out of Memory Exception
- From: Pete Davis
- Re: Out of Memory Exception
- From: Truong Hong Thi
- Out of Memory Exception
- Prev by Date: Re: Data Storage for news client
- Next by Date: Status Bar Counter
- Previous by thread: Re: Out of Memory Exception
- Next by thread: Re: Out of Memory Exception
- Index(es):
Relevant Pages
|