473,411 Members | 2,083 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,411 software developers and data experts.

The image could not be added to the ImageList

Hello All,

I got the following exception when i tried to add 4000 images to
listview with the image list. I am running the application in the
windows 2000. It is working under the windows xp. Any idea will be
helpful. Thanks.

Exception: System.InvalidOperationException: The image could not be
added to the ImageList.
at System.Windows.Forms.ImageList.AddToHandle(Origina l original,
Bitmap bitmap)
at System.Windows.Forms.ImageCollection.Add(Original original)
at System.Windows.Forms.ImageCollection.Add(Image value, Color
transparentColor)
at ImageListTest.Form1.button_CreateImagesList_Click( Object sender,
EventArgs e) in c:\dev\iview systems\itrak
product\4.0\test\imagelisttest\form1.cs:line 235
my pieces of codes are following:

for(int i=0;i<count;i++)
{
try
{
currentIdx = this.imageList1.Images.Add(this.pictureBox1.Image, System.Drawing.Color.Empty);
ListViewItem item = new ListViewItem("Tester", currentIdx);
items[i] = item;
}
catch(Exception ex)
{
if(this.textBox_ErrorMessage.Text.ToString().Trim( ).Length < 2)
{
this.textBox_ErrorMessage.AppendText("First Error Image Index="
+ currentIdx.ToString());
this.textBox_ErrorMessage.AppendText(System.Enviro nment.NewLine
+ "Exception: " + ex.ToString());
}
MessageBox.Show(ex.ToString());
break;
}
}
try
{
this.listView1.BeginUpdate();
this.listView1.Items.AddRange(items);
this.listView1.EndUpdate();
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
Nov 16 '05 #1
0 1104

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

Similar topics

1
by: Anthony Boudouvas | last post by:
Hi to all, i have a treeview that i put some nodes in it with their repsective images. If i try to change the image and set it to some other ImageList index, nothing happens. The code i use...
0
by: Silvia | last post by:
Hi, I have a program that capture images and put this into a listview (using imagelist), the problem is when I delete de image the listview, when do that and capture another image, the image...
5
by: SeanT | last post by:
Greetings and salutations! I am having a real issue with the VB.NET TreeView control. I need to display an image (a.k.a. logo, picture, etc) from a file as the treenode object. I can not seem to...
5
by: Bob | last post by:
Hi, I have a treeview which contains nodes of a class (classA) derived from treenode. These classA nodes may contain nodes of a class (ClassB) derived from classA. The form load populates a...
0
by: Tuyen Pham via DotNetMonster.com | last post by:
The problem is: System.InvalidOperationException: The image could not be added to the ImageList. at System.Windows.Forms.ImageList.AddToHandle(Original original, Bitmap bitmap) at...
0
by: Sarika | last post by:
Hi, I am a little confused about associating an image w/ the VB.NET TreeView Control. My specific requirement is that I want to associate an image w/ some specific nodes in the TreeView only. ...
5
by: Tony Clark | last post by:
Hi, I have a bmp that is set in a panel, i want to make the white color in the bmp image transparent so i can see the color of the panel below. How is this done? thanks tony
1
by: Kristopher Wragg | last post by:
Hi, I'm creating a customized picturebox that will have an array of images and some properties that will allow the picturebox to change its image to one of the images in the array depending on...
2
by: =?Utf-8?B?S2VuTg==?= | last post by:
We're using a System.Windows.Forms.ImageList to store a bunch of Images that I've loaded, and rendering each image in the ImageList during a draw loop. The process was running unusually slow and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.