Hi All,
I have an array of 16x16 bitmaps (60 total). I've tried adding the
array to the ImageList with the Add method, but the TreeView paints as
if no BMP is present.
The problem is the method does not 'break out' the bitmaps. If I
specify Index 0, I get an unexpected result (horizontal compressing of
the file).
How do I direct the TreeView/ImageList team to treat this as an array,
rather than a single image? I found an old post, but the suggestion
was incorrect (http://groups.google.com/group/
microsoft.public.dotnet.languages.csharp/browse_thread/thread/
151b30d4814eda55/).
What I don't want to do is add 60 individual files to the project. It
is bad enough that the program cannot find one file in the Resource
directory. I don't want to pollute the space any further with 60
additional files.
Jeff
ImageList images = new ImageList();
TreeView tree = new TreeView();
// Resource file previously copied into .\bin\Debug
images.Images.Add(new Bitmap(<file>)); // 60 images
// ImageSize does not produce expected result... The
// control does not deduce there are 60 elements
images.ImageSize = new System.Drawing.Size(16,16);
// Throws an error - width < 256
images.ImageSize = new System.Drawing.Size(960,16);
tree.Images = images;