我是新手,WPF
并且有Path
如下数据:
M44.3364,36.7461C42.2004,42.9021,36.3504,47.3241,29.4644,47.3241C20.7724,47.3241,13.7244,40.2761,13.7244,31.5851
现在我想得到这个路径数据的高度和宽度,怎么做呢?
你可能会得到Bounds
路径的Data
:
<Path x:Name="path" Stroke="Black"
Data="M44.3364,36.7461C42.2004,42.9021,36.3504,47.3241,29.4644,47.3241C20.7724,47.3241,13.7244,40.2761,13.7244,31.5851"/>
代码:
Rect bounds = path.Data.Bounds;