Ben
Ben

Reputation: 4110

How to get PathFigureCollection bounding rectangle

Is it possible to find the bounding rectangle of a PathFigureCollection object, in c# ? (I know how to get it using a FrameworkElement but that's not what I want)

Upvotes: 3

Views: 937

Answers (1)

abdelkarim
abdelkarim

Reputation: 596

Try to include your PathFigureCollection in a PathGeometry object, and then you can access the bounding rectangle via the Bounds property.

Example

var geometry = new PathGeometry {
    Figures = new PathFigureCollection()
};
var boundingRect = geometry.Bounds;

Upvotes: 7

Related Questions