Hi,
I have a UltraTreeView that has about 15 nodes each with a single child. If I have hot tracking turned on, and just run my mouse over the tree nodes (there is no mouse_over event) the images just dissapear after a few seconds of my constant mouse movement. The whole control tuns sluggish if I try to scroll left and right.
Worse yet, if I have tool tips enabled (override/tipstylenode) I get an out of memeory error with the above. I am using 10.2.20102.2026.
Thanks.
Sorry, I need to add more.
Been doing more trial error and even if I turn off tips and not tracking (or both on, or whatever combination IE they have nothing to do with it), just load the tree, move mouse around the control for about 5 - 10 seconds the icons flicker on and off, things get slow, and I get out of memory here:
at System.Drawing.Image.FromHbitmap(IntPtr hbitmap, IntPtr hpalette) at System.Drawing.Image.FromHbitmap(IntPtr hbitmap) at System.Windows.Forms.ImageList.GetBitmap(Int32 index) at System.Windows.Forms.ImageList.ImageCollection.get_Item(Int32 index) at System.Windows.Forms.ImageList.ImageCollection.get_Item(String key) at Infragistics.Win.AppearanceData.GetImageFromImageList(Object image, Im
Wish there was a way to edit a post.
Here is the full error. Furthermore in production, if I just run the program, watch the process and memory usage and just run my mout over two node back and forth the memroy goes CRAZY, up to about 2 GIGs, before dropping back down to 50K. This is a really big issue for us.
System.OutOfMemoryException: Out of memory. at System.Drawing.Image.FromHbitmap(IntPtr hbitmap, IntPtr hpalette) at System.Drawing.Image.FromHbitmap(IntPtr hbitmap) at System.Windows.Forms.ImageList.GetBitmap(Int32 index) at System.Windows.Forms.ImageList.ImageCollection.get_Item(Int32 index) at System.Windows.Forms.ImageList.ImageCollection.get_Item(String key) at Infragistics.Win.UltraWinTree.NodeSelectableAreaUIElement.GetImage(Object image) at Infragistics.Win.UltraWinTree.NodeSelectableAreaUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements() at Infragistics.Win.UltraWinTree.UltraTreeUIElement.PositionChildElements() at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive) at Infragistics.Win.UIElement.VerifyChildElements() at Infragistics.Win.UltraWinTree.UltraTree.OnMouseEnterElement(UIElementEventArgs e) at Infragistics.Win.UltraControlBase.Infragistics.Win.IUltraControl.FireMouseEnterElement(UIElementEventArgs e) at Infragistics.Win.ControlUIElementBase.ElementEntered(UIElement element, Boolean triggerMouseLeavesOnly) at Infragistics.Win.ControlUIElementBase.ProcessMouseMoveHelper(Object sender, MouseEventArgs e) at Infragistics.Win.ControlUIElementBase.ProcessMouseMove(Object sender, MouseEventArgs e) at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e) at Infragistics.Win.UltraControlBase.OnMouseMove(MouseEventArgs e) at Infragistics.Win.UltraWinTree.UltraTree.OnMouseMove(MouseEventArgs e)
It's a bit hard to follow what you are describing. Are you saying that the MouseOver event of the control is not firing at all?
When you say the images are disappearing, what images are you referring to?
What version of the control are you using?
Can you post a small sample project demonstrating the issue?
I am using 10.2.20102.2026.
There is NO mouse over event. The tree loads and each node has a left Image added (.LeftImages.Add(1)). There is an image list set to the tree.
After the tree loads, if I just take my mouse pointer, and move it back and forth over the nodes, I get the above picture. (I attached it and it wiped out my message).
I can't give you a small project unfortuantly, we have a rather large project and it would be hard for me to give JUST this section, plus it's tied to a database etc.
The ImageList.ImageCollection's indexer returns a clone of the image at that position every time it is accessed. When you add an integer to the LeftImages collection, the tree has no choice but to use the indexer to get the image, which means every time the control paints, it triggers the creation of dozens/hundreds/thousands of System.Drawing.Image instances.
When you add the images to the LeftImages collection, don't assign the index. Get a reference to the image via ImageList.Images[n], and add a reference to the Image instance to the LeftImages collection. Doing this will make it unnecessary for the control to access the ImageCollection's indexer, thus preventingthe OutOfMemoryException.
I used to have it that way, please refer to this post:
http://community.infragistics.com/forums/t/42411.aspx
Do you mean I should have (and keep in mind, I have an imagelist set at the tree control)
node.LeftImages.Add[imageList.Images[3])
vs
no.LeftImages.Add(1)
Or should I just point it at a global resource?
node.LeftImages.Add(global::project.RSXImages.Image123)
Again, the above post has me a bit confused..only because when I had it the other way performance was a DOG., unless I missing something.
It would seem that i responded to that post as well, with basically the same advice: don't assign indexes to the LeftImages collection, so that the ImageList does not clone images. I don't know what else might have been causing you problems, but going by the age of that post I would think you should have received an answer about that by now.
Hello,
I have created following Case for you: CAS-57242-WYDQSQ
I will update you once I have more information for you.
Please do not hesitate to ask if you have any other questions.
So you guys know, I get this behaviour for any tree in my app that is using an imagelist. And we had a lot.
Is it possible the imae list is corrupted? I have another tree where I use the index and calling thousands of nodes with images and no issue like this. The test cases I showed you are with 3 or 4 nodes.
I changed everything to point to a resx file instead, and now no issue. But I had to rewrite our entire subsystem that checks the node index for rights and all. Had to go back and add a freaking has table to each node with the old index #. (we are already using the datakey, tag, and key property).
Also, any issue sharing the same image list with two trees? I was thnking about the value lists, and how I have to clone them to use in a data grid if I am using it on a drop down on the same form.