473,608 Members | 2,264 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image.FromFile fails...

pnp
Why does Image.FromFile( ) fails (OutOfMemoryExc eption) 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 EnableVisualSty les() is being used matter?

Thanks in advance,
Peter.
Nov 16 '05 #1
1 1809
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,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"pnp" <pnp.at.softlab .ece.ntua.gr> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Why does Image.FromFile( ) fails (OutOfMemoryExc eption) 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 EnableVisualSty les() is being used matter?

Thanks in advance,
Peter.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
5325
by: David Lozzi | last post by:
Howdy, I have a function that uploads an image and that works great. I love ..Nets built in upload, so much easier than 3rd party uploaders! Now I am making a public function that will take the path of the uploaded image, and resize it with the provided dimensions. My function is below. The current function is returning an error when run from the upload function: A generic error occurred in GDI+. Not sure what exactly that means. From what...
6
1507
by: Jerry West | last post by:
I'm a newbie to .NET from VB6. I have a Form with a Panel control on it. When the Form loads it maximizes and so does the Panel control. I then fill an array with the path to images at a specific folder. At that point a timer fires every x seconds which calls a routine that draws an image onto the Panel. This works great the first time the code runs. But each subsquent timer event fails to load a new image --it is always the same image...
14
16318
by: Steve K. | last post by:
I have a method that I use to get a System.Drawing.Image from a file without keeping a handle on the file open (so I can delete the file). Here is the code: <code> public static Image ImageFromFileReleaseHandle(string filename) { FileStream fs = null; try {
1
2833
by: Tim Kelley | last post by:
I need to read the metadata of an image, display it on the screen and allow the user to change it and then re-write the metadata back into the image. The issue I am having is if I try to rename or delete the existing image before re-writing the image file I get an error stating that the image is in use. I am using Image.FromFile() to read the file. I have tried disposing of the image and running the garbage collector (GC.Collect()), but...
0
8002
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8496
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8475
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8148
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8338
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
3962
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4024
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1594
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1329
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.