Path1.Stroke = new SolidColorBrush(Colors.Blue) P.Figures.Add(new PathFigure(((PolyLineSegment)ps).Points, psc, true)) PathSegmentCollection psc = new PathSegmentCollection() PathSegment ps = new PolyLineSegment(CalculateHarmonicPolygon(6, 100, new Point(this.Width / 2, this.Height / 2)), true) ![]() Here's some methods of an old WinForm application from me to create harmonic polygons (updated types for wpf (basically floats to doubles :-) )): private void UserControl_Loaded(object sender, RoutedEventArgs e) Segment.Point = new Point(x + 0.5 * hexagon.StrokeThickness, Private void AddPoint(double x, double y) PathGeometry geometry = new PathGeometry() įigure.StartPoint = new Point(0.25 * width, 0) Private void CreateDataPath(double width, double height) ![]() Private void hexagon_Loaded(object sender, RoutedEventArgs e)ĬreateDataPath(hexagon.Width, hexagon.Height) You could for example handle the Loaded event of the Path like this: public partial class MainWindow : Window ![]() You better create the hexagon programmatically as described here:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |