Notes
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Cet exemple montre comment créer plusieurs sous-chemins dans un PathGeometry. Pour créer plusieurs sous-chemins, vous créez un PathFigure pour chaque sous-chemin.
Exemple :
L’exemple suivant crée deux sous-chemins, chacun d’eux un triangle.
<Path Stroke="Black" StrokeThickness="1">
<Path.Data>
<PathGeometry>
<PathGeometry.Figures>
<PathFigureCollection>
<PathFigure IsClosed="True" StartPoint="10,100">
<PathFigure.Segments>
<PathSegmentCollection>
<LineSegment Point="100,100" />
<LineSegment Point="100,50" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
<PathFigure IsClosed="True" StartPoint="10,10">
<PathFigure.Segments>
<PathSegmentCollection>
<LineSegment Point="100,10" />
<LineSegment Point="100,40" />
</PathSegmentCollection>
</PathFigure.Segments>
</PathFigure>
</PathFigureCollection>
</PathGeometry.Figures>
</PathGeometry>
</Path.Data>
</Path>
L’exemple suivant montre comment créer plusieurs sous-chemins à l’aide d’une syntaxe d’attribut Path XAML. Chacun M
crée un sous-chemin afin que l’exemple crée deux sous-chemins qui dessinent chacun un triangle.
<Path Stroke="Black" StrokeThickness="1"
Data="M 10,100 L 100,100 100,50 Z M 10,10 100,10 100,40 Z" />
(Notez que cette syntaxe d’attribut crée en fait un
Voir aussi
.NET Desktop feedback