Can someone please explain me the significance IconicNode’s Initialize method ?
I am using the GoIconicNode’s Image.Image property explicitily to set metafile images. Yet, I need to call IconicNode’s Initialize method with a dummy imagelist and a dummy transparent bitmap.
When I dont call the IconicNode’s initialize method I cannot see the node’s at all.
Can I just use 1 static image list with 1 transparent bitmap and use that amongst all the nodes ? Since the bitmap is never shown, and also to save memory.
You should always call the Initialize method.
You should not set GoIconicNode.Image.Image unless you are dynamically generating images in memory. If you have “static” images in an ImageList or a ResourceManager, you ought to be setting the Index or Name property of the node’s GoImage by setting GoIconicNode.Image.Index or .Image.Name.
If you set GoImage.Index or GoImage.Name, that index or name information is serialized as part of the GoImage, so that the GoImage can be deserialized with the right information.
If you set the GoImage.Image property alone, the GoImage when deserialized cannot display the right image, since .NET Images are not serializable.
Yes I do have scenarios where the user can browse for images on his/her disk and configure them for various nodes.
Hence I may have to use the GoIconincNode.Image property. But I am not using any serialization features so this shouldnt be a problem.
But can I just make a static image list with 1 transparent image in it and use it for GoIconicNode.Initialize of all the nodes that I create. Will there be any side-effects ?