Border for GoIconicNode


#1

I would like to create a colored border around a GoIconicNode’s Icon. Is there an easy way to do this?
Thanks!
Jeff


#2

I’m not sure which would be easiest for you, but you have several choices.

  1. Override Paint and ExpandPaintBounds. Your override of Paint should first draw the border you need given the .Icon.Bounds. Then call the base method. Your override of ExpandPaintBounds should call the base method and then Inflate the resulting RectangleF by half the width of your border.
  2. Or… Replace your GoImage Icon with a GoGroup consisting of both a GoRectangle and a GoImage, where the rectangle is slightly larger than the image object. But note that GoIconicNode.Image will now return null/nothing, since the Icon is now a group instead of an image.
  3. Or… override GoIconicNode.CreateIcon to return an instance of a subclass of GoImage that also has overridden Paint and ExpandPaintBounds.