Displaying a polygon
Posted: 12 Dec 2013, 14:15
Hi!
In WPF there is a Polygon shape. How to have the same functionality in Noesis? I found the Path class, but cannot figure out how to use it instead of Polygon in my code. Note that I am doing it from C# code, not XAML.
EDIT
I managed to draw a polygon, but it is not filled. My code looks like this:
Thanks!
In WPF there is a Polygon shape. How to have the same functionality in Noesis? I found the Path class, but cannot figure out how to use it instead of Polygon in my code. Note that I am doing it from C# code, not XAML.
EDIT
I managed to draw a polygon, but it is not filled. My code looks like this:
Code: Select all
var result = new Path();
result.SetFill(new SolidColorBrush(Noesis.Color.Yellow));
result.SetStroke(new SolidColorBrush(Noesis.Color.Green));
var streamGeometry = new StreamGeometry();
var context = streamGeometry.Open();
context.BeginFigure(new Point(10, 10), true);
context.LineTo(new Point(10, 40));
context.LineTo(new Point(40, 40));
context.Dispose();
result.SetFill(new SolidColorBrush(Noesis.Color.Yellow));
result.SetData(streamGeometry);