GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoObject Class / Paint Method
The Graphics object with which to draw.
The GoView provides additional context for this painting operation.
In This Topic
    Paint Method (GoObject)
    In This Topic
    Render this object to a Graphics object.
    Syntax
    public virtual void Paint( 
       Graphics g,
       GoView view
    )

    Parameters

    g
    The Graphics object with which to draw.
    view
    The GoView provides additional context for this painting operation.
    Remarks

    This method may get called frequently and should not modify any object or view state.

    The default implementation paints nothing. Each derived class should override this method.

    The view parameter is useful for customizing the drawing behavior based on the kind of view to which we are drawing. For example, the GoView.GoView.ShadowOffset property specifies the size of the drop shadow painted by objects whose Shadowed property is true.

    If you override this method, you may also need to override ExpandPaintBounds, and perhaps the other geometry methods, including ComputeBounds, ContainsPoint, ContainedByRectangle, GetNearestIntersectionPoint(PointF,PointF,PointF), and other methods such as AddSelectionHandles and DoResize.

    Furthermore, in the implementation of a property setter that causes the paint bounds to change, you will need to call InvalidateViews before actually changing your object's state, so that views will get a chance to notice the paint bounds before it changes.

    See Also