New Bitmap causes chews up a lot of memory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

There seems to be a memory leak problem in loading an image in .NET

I am trying to load up an image, which is 1MB in size on the disk. When I load up the image it expands out to atleast 25MB in memory. THIS cannot be right!!

The line of code I am using is:

"formImage = new Bitmap("Form.jpg");"

Does anyone know a fix around this?? Please help.
 
* =?Utf-8?B?QXNo?= said:
There seems to be a memory leak problem in loading an image in .NET

I am trying to load up an image, which is 1MB in size on the disk. When I load up the image it expands out to atleast 25MB in memory. THIS cannot be right!!

The line of code I am using is:

"formImage = new Bitmap("Form.jpg");"

Does anyone know a fix around this??

Is the bitmap file stored in the color depth of the screen?
 
if you load a compressed image, it
will be decompressed into memory.
otherwise you wouldn't be able to
draw or display it.

so i guess your 1MB-jpeg contains
a 25MB bitmap.


carsten neubauer
http://www.c14sw.de/
 
Back
Top