2

我是新手,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

现在我想得到这个路径数据的高度和宽度,怎么做呢?

4

1 回答 1

2

你可能会得到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;
于 2013-06-28T07:03:23.373 回答