Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 c# 中找到 PathFigureCollection 对象的边界矩形?(我知道如何使用 FrameworkElement 来获取它,但这不是我想要的)
尝试将您包含PathFigureCollection在一个PathGeometry对象中,然后您可以通过该Bounds属性访问边界矩形。
PathFigureCollection
PathGeometry
Bounds
例子
var geometry = new PathGeometry { Figures = new PathFigureCollection() }; var boundingRect = geometry.Bounds;