Image.FromFile fails...

  • Thread starter Thread starter pnp
  • Start date Start date
P

pnp

Why does Image.FromFile() fails (OutOfMemoryException) when I try to load an
icon file from the filesystem, that contains 32bit and 24bit icons, but
works fine for Icon files with only 32bit icons (and 8bit icons)?

Does the fact that EnableVisualStyles() is being used matter?

Thanks in advance,
Peter.
 
Hi,

I haven;t had this problem before, the only difference is that the image is
not an Icon, why dont you use the Icon class instead of the Image?

If you need it to convert to an Image for some reason you can use
Icon.ToImage()

Cheers,
 
Back
Top