Bonjour,
Je voudrais dessiner un petit triangle par code en utilisant le Path.
J'utilise le code suivant:
Il me dessine bien mes 3 lignes, mais par contre, il ne colorie pas la surface du triangle en noir.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32 Dim p As New Path Dim blackBrush As New SolidColorBrush() blackBrush.Color = Colors.Black Dim LG As New LineGeometry LG.StartPoint = New Point(20, 30) LG.EndPoint = New Point(70, 200) Dim L2G As New LineGeometry L2G.StartPoint = New Point(70, 200) L2G.EndPoint = New Point(150, 300) Dim L3G As New LineGeometry L3G.StartPoint = New Point(150, 300) L3G.EndPoint = New Point(20, 30) Dim GG As New GeometryGroup GG.Children.Add(LG) GG.Children.Add(L2G) GG.Children.Add(L3G) p.Data = GG p.Stroke = blackBrush p.StrokeThickness = 1 p.Fill = blackBrush LayoutRoot.Children.Add(p)
Quelqu'un a t'il une idée ? du pourquoi et du comment ?
Partager