473,394 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Bitmap.FromFile generates Out Of Memory with some icons!!

I tried loading an icon to an imageList using the following method:

Image cc = Bitmap.FromFile("C:\\myicon.ico");
imageList1.Images.Add(cc);

It works with some icons but generates an "Out of Memory" error with some
others. The strange thing is that when I try to add the icon manually to the
imageList, it adds it without problems!!

One of the icons that generates this problem is:

http://www.telegraph.co.uk/favicon.ico

Can anyone help?

Aug 20 '07 #1
1 4204
"Dana" <Da**@atasoft.comwrote in message
news:eF**************@TK2MSFTNGP05.phx.gbl...
>I tried loading an icon to an imageList using the following method:

Image cc = Bitmap.FromFile("C:\\myicon.ico");
imageList1.Images.Add(cc);

It works with some icons but generates an "Out of Memory" error with some
others. The strange thing is that when I try to add the icon manually to
the imageList, it adds it without problems!!

One of the icons that generates this problem is:

http://www.telegraph.co.uk/favicon.ico

Can anyone help?



favicon.ico is in a format not supported by the framework (and GDI+), OOM
exceptions are thrown when trying to load an invalid or non supported format
BitMap file, try to save the file in a supported format.

Willy.

Aug 21 '07 #2

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

Similar topics

8
by: Paul Loveless | last post by:
Hi all, I've written the following code to retrieve the file format of an image file: Dim objImageFormat As ImageFormat objImageFormat = Me.SourceImage.RawFormat If...
2
by: active | last post by:
I find Bitmap.Save works for WMF files but Bitmap.FromFile does not. If I use FromFile on a WMF file that came with VS I get an exception. If I use it on a WMF file created with Bitmap.Save I...
1
by: Mamatha | last post by:
Hi I have one application ,that diplays data from database into the listview control.While adding data to the listview i want to display an icon to the leftside of the first column's data.Here...
2
by: Andrew Morton | last post by:
I've opened a bitmap from a jpg file with Dim bmp As New Bitmap(IO.Path.Combine(origFolder, value)) ' now resize the image into another bitmap and save that where origFolder is the directory...
1
by: tsteinke | last post by:
I am in the process of creating a System.Drawing.Bitmap from a block of memory containing a DIB Bitmap. I can think of about a half dozen ways to do this. For perfomance reasons I don't want to be...
2
by: GT | last post by:
Could someone please explain how to add images to a ListView other than in the first column?
1
by: Florencio Cano | last post by:
How can I monitor with a Python script how much memory does a process use in Windows? I want to do statistics about memory consumption of processes like Firefox, Antivirus, etc. When I search in...
11
by: tregan3 | last post by:
I'm having trouble opening a color .tiff. Calling Image.FromStream on the .tiff throws an "invalid parameter" error. Calling Bitmap.FromFile on the .tiff throws a "System.OutOfMemory" error...
0
by: abhinavrai | last post by:
my task bar does not show the icons like charging status,sound,antivirus etc icons. even when i manually, from the control panel place the icons on the task bar but after restart again its invisible...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
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...

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.