I want to create some Nodes with images in the Internet, but It is of no effect when I replace the iconname by a URL where I could get the image in GoGeneralNode.Initialize method, so how to create Nodes with URL image resouces?
btw:The coordinate system used by the document is the same as the default coordinate system for controls, each unit corresponds to a pixel, why do document coordinates use single (float) values,not integer values?
There’s some example code in the FAQ – search for “URL”.
If you are using this for a GoGeneralNode, you’ll want to inherit from GoNodeIcon instead of GoImage, and you’ll want to override GoGeneralNode.CreateIcon to create and return an instance of your URLImage class.
Each document coordinate unit corresponds to a pixel when the view’s DocScale is 1. More precision is required in order to handle resizing objects or rescaling the view.
For example, say you have a 100x200 size GoGroup that contains several GoShapes. Let’s say you resize the group to be 1x1. (It doesn’t matter if you do it programmatically or the user does it interactively–the same code executes when the group’s Bounds is changed.) The standard behavior for GoGroup.RescaleChildren is to shrink the sizes of each child object correspondingly, and to reposition them correspondingly too.
That way, if you resize the group again, say by making it 100x200, each of the child objects will be restored to their original positions and sizes (or at least very close). If document coordinates were integers, the lack of precision would result in a complete loss of accuracy, since upon shrinking all the children would have to be 1x1 or 0x1 or 1x0 or 0x0, and therefore would not know how to be scaled up again later.
Of course, one way to avoid that precision problem is to override RescaleChildren and/or LayoutChildren, if you have additional information about how the child objects should be sized and positioned that the default behavior of GoDiagram cannot anticipate.
thank you very much