GetBounds (StrokeCollection)


Returns a Rect that is the bounding box of the strokes in the collection.

retval = object.GetBounds()

Type: Rect

The bounding box of the strokes in the StrokeCollection.

Do not attempt to set values in the returned Rect; it should be used for reference only.

var newRect = inkPresenter.Strokes.GetBounds();

For the strokes shown in the following illustration that render the word "Ink!", the Rect that would be returned by calling the GetBounds method is the red box.

Bounding box

The bounding box of an inkcanvas

Scenarios for this method include using the returned Rect as input for a RectangleGeometry that will display the bounding box in the user interface, or checking for intersecting strokes or other types of hit-testing.

Community Additions