PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework bmp = new Bitmap(FilePath); and OOM CF 2.0

Reply

bmp = new Bitmap(FilePath); and OOM CF 2.0

 
Thread Tools Rate Thread
Old 17-01-2006, 06:52 AM   #1
Tomppa
Guest
 
Posts: n/a
Default bmp = new Bitmap(FilePath); and OOM CF 2.0


I have an ICOP board that has 128 onboard RAM.

When I call bmp = new Bitmap(FilePath); and the jpg that it is loading is
over 500K I get an out of Memory error.

I can load this larger jpg using ImageViewer or browing to it with IE
without errors.

This happens in debug mode and when I create a release build and run the exe
directly on the device

Why is this happening? Any suggestions on fixing this? I tried
GC.Collect() before loading the bmp and that did not help.


  Reply With Quote
Old 18-01-2006, 08:36 PM   #2
Ilya Tumanov [MS]
Guest
 
Posts: n/a
Default Re: bmp = new Bitmap(FilePath); and OOM CF 2.0

500K JPEG can easily take out all available virtual memory (which is limited
to 32 Mb on CE) while uncompressed.

Please make sure _uncompressed_ size is not too big.

Also please make sure you're disposing of all bitmaps after use before
loading new images.

--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group...framework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).

"Tomppa" <tomppa@g-m-a-i-l.com> wrote in message
news:uikiMLzGGHA.3532@TK2MSFTNGP14.phx.gbl...
>I have an ICOP board that has 128 onboard RAM.
>
> When I call bmp = new Bitmap(FilePath); and the jpg that it is loading is
> over 500K I get an out of Memory error.
>
> I can load this larger jpg using ImageViewer or browing to it with IE
> without errors.
>
> This happens in debug mode and when I create a release build and run the
> exe directly on the device
>
> Why is this happening? Any suggestions on fixing this? I tried
> GC.Collect() before loading the bmp and that did not help.
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off