Image.FromFile fails...

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.
 
I

Ignacio Machin \( .NET/ C# MVP \)

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top