• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Shapes.Polyline类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Shapes.Polyline的典型用法代码示例。如果您正苦于以下问题:C# Polyline类的具体用法?C# Polyline怎么用?C# Polyline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Polyline类属于System.Windows.Shapes命名空间,在下文中一共展示了Polyline类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MainWindow

        public MainWindow()
        {
            InitializeComponent();
            Polyline line = new Polyline();
            Polyline line2 = new Polyline();
            line.VerticalAlignment = VerticalAlignment.Center;
            line.Stroke = SystemColors.WindowTextBrush;
            line.StrokeThickness = 2;

            for (int i = -200; i < 200; i++)
            {
                line.Points.Add(new Point(i, Algorithm.CalFitness(i)));
            }

            panel.Children.Add(line);

            Algorithm alogrithm = new Algorithm();

            for (int j = 0; j < Algorithm.MAX_CHANGE; j++)
            {
                List<Polyline> lines = alogrithm.Graph();
                for (int i = 0; i < lines.Count; i++)
                {
                    panel.Children.Add(lines[i]);
                }

                alogrithm.Running ();
            }

            bestX.Content = alogrithm.GlobeBestX.ToString();
            bestY.Content = alogrithm.GlobleBestFitness.ToString();
        }
开发者ID:JokerHB,项目名称:PSOLeraning,代码行数:32,代码来源:MainWindow.xaml.cs


示例2: DrawPuzzle

        public void DrawPuzzle(DotPuzzle puzzle, Canvas colorPointCanvas, Polyline figurePolyline)
        {

            try
            {
                if (puzzle != null)
                {
                    colorPointCanvas.Children.Clear();
                    figurePolyline.Points.Clear();
                    for (int i = 0; i < puzzle.Dots.Count; i++)
                    {
                        Grid dotContainer = new Grid();
                        dotContainer.Width = 80;
                        dotContainer.Height = 80;
                        if (i == 0 || i == puzzle.Dots.Count - 1)
                        {
                            if (i == 0)
                                dotContainer.Children.Add(new Canvas() { Background = new ImageBrush(ConvertBitmapToBitmapSource((Resources.greenBall))) }); // do punktu startowego i koncowego potrzebna grafika, najlepiej jakas animacja
                            if (i == puzzle.Dots.Count - 1)
                                dotContainer.Children.Add(new Canvas() { Background = new ImageBrush(ConvertBitmapToBitmapSource((Resources.redBall))) });
                            

                            TextBlock dotLabel = new TextBlock();
                            //dotLabel.Text = (i + 1).ToString();
                            dotLabel.Foreground = Brushes.White;
                            dotLabel.FontSize = 35;
                            dotLabel.HorizontalAlignment = HorizontalAlignment.Center;
                            dotLabel.VerticalAlignment = VerticalAlignment.Center;
                            dotContainer.Children.Add(dotLabel);

                            Canvas.SetTop(dotContainer, puzzle.Dots[i].Y - (dotContainer.Height / 2));
                            Canvas.SetLeft(dotContainer, puzzle.Dots[i].X - (dotContainer.Width / 2));
                            colorPointCanvas.Children.Add(dotContainer);

                        }
                        else
                            dotContainer.Children.Add(new Ellipse() { Fill = figurePolyline.Stroke });

                        //TextBlock dotLabel = new TextBlock();
                        ////dotLabel.Text = (i + 1).ToString();
                        //dotLabel.Foreground = Brushes.White;
                        //dotLabel.FontSize = 35;
                        //dotLabel.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
                        //dotLabel.VerticalAlignment = System.Windows.VerticalAlignment.Center;
                        //dotContainer.Children.Add(dotLabel);

                        //Canvas.SetTop(dotContainer, puzzle.Dots[i].Y - (dotContainer.Height / 2));
                        //Canvas.SetLeft(dotContainer, puzzle.Dots[i].X - (dotContainer.Width / 2));
                        //ColorPointCanvas.Children.Add(dotContainer);
                        figurePolyline.Points.Add(new Point(puzzle.Dots[i].X, puzzle.Dots[i].Y));

                    }
                }
            }
            catch (Exception ex)
            {


            }
        }
开发者ID:guozanhua,项目名称:KinectMiniGames,代码行数:60,代码来源:Draftsman.cs


示例3: DrawLine

        public void DrawLine(IList<ScreenPoint> points, OxyColor stroke, double thickness, double[] dashArray,
                             OxyPenLineJoin lineJoin, bool aliased)
        {
            var e = new Polyline();
            if (stroke != null && thickness > 0)
            {
                e.Stroke = GetCachedBrush(stroke);

                switch (lineJoin)
                {
                    case OxyPenLineJoin.Round:
                        e.StrokeLineJoin = PenLineJoin.Round;
                        break;
                    case OxyPenLineJoin.Bevel:
                        e.StrokeLineJoin = PenLineJoin.Bevel;
                        break;
                    //  The default StrokeLineJoin is Miter
                }

                if (thickness != 1) // default values is 1
                    e.StrokeThickness = thickness;
                if (dashArray != null)
                    e.StrokeDashArray = new DoubleCollection(dashArray);
            }
            // pl.Fill = null;
            if (aliased)
                e.SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);

            var pc = new PointCollection(points.Count);
            foreach (var p in points)
                pc.Add(ToPoint(p));
            e.Points = pc;

            Add(e);
        }
开发者ID:Cheesebaron,项目名称:oxyplot,代码行数:35,代码来源:GeometryRenderContext.cs


示例4: OnStylusDown

        protected override void OnStylusDown(StylusDownEventArgs args)
        {
            base.OnStylusDown(args);
            Point ptStylus = args.GetPosition(canv);

            // ���� �ձ� Polyline�� ������ ���濡 ���
            polyStylus = new Polyline();
            polyStylus.Stroke = brushStylus;
            polyStylus.StrokeThickness = widthStroke;
            polyStylus.StrokeStartLineCap = PenLineCap.Round;
            polyStylus.StrokeEndLineCap = PenLineCap.Round;
            polyStylus.StrokeLineJoin = PenLineJoin.Round;
            polyStylus.Points = new PointCollection();
            polyStylus.Points.Add(ptStylus);

            // �׸��ڿ����� �� Polyline
            polyShadow = new Polyline();
            polyShadow.Stroke = brushShadow;
            polyShadow.StrokeThickness = widthStroke;
            polyShadow.StrokeStartLineCap = PenLineCap.Round;
            polyShadow.StrokeEndLineCap = PenLineCap.Round;
            polyShadow.StrokeLineJoin = PenLineJoin.Round;
            polyShadow.Points = new PointCollection();
            polyShadow.Points.Add(ptStylus + vectShadow);

            // ������ ��� �������� ������ �׸��� ���������� ����
            canv.Children.Insert(canv.Children.Count / 2, polyShadow);

            // ���� �������� ����� ���������� �߰�
            canv.Children.Add(polyStylus);

            CaptureStylus();
            isDrawing = true;
            args.Handled = true;
        }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:35,代码来源:ShadowTheStylus.cs


示例5: Spiral

        public Spiral()
        {
            Title = "Spiral";

            // Make Canvas content of window.
            Canvas canv = new Canvas();
            canv.SizeChanged += CanvasOnSizeChanged;
            Content = canv;

            // Make Polyline child of Canvas.
            poly = new Polyline();
            poly.Stroke = SystemColors.WindowTextBrush;
            canv.Children.Add(poly);

            // Define the points.
            Point[] pts = new Point[numpts];

            for (int i = 0; i < numpts; i++)
            {
                double angle = i * 2 * Math.PI / (numpts / revs);
                double scale = 250 * (1 - (double) i / numpts);

                pts[i].X = scale * Math.Cos(angle);
                pts[i].Y = scale * Math.Sin(angle);
            }
            poly.Points = new PointCollection(pts);
        }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:27,代码来源:Spiral.cs


示例6: tekenLijn

        private void tekenLijn()
        {
            //Polyline aanmaken
            Polyline line = new Polyline();
            line.Stroke = Brushes.Aquamarine;
            line.Visibility = Visibility.Visible;
            line.StrokeThickness = 3;

            //Punten
            PointCollection punten = new PointCollection();

            //Dingen die in de formule ingevuld gaan worden
            double a = 100;// canvas.Height / 2; //De evenwichtsstand
            double b = 2;// canvas.Height / 4; //De amplitude
            //double d = Convert.ToDouble(ActualHeightProperty.ToString()) ; //de x-coördinaat van een punt waar de grafiek stijgend de evenwichtsstand snijdt

            double windowbreedte = canvas.ActualWidth;
            double windowhoogte = canvas.ActualHeight/2;

            //Alle punten overlopen
            for (int i = 0; i < windowbreedte; i++)
            {
                //punten.Add(new Point() { X = i, Y = windowhoogte * (1 - Math.Sin(i * (Math.PI / (windowbreedte/6))))});
                punten.Add(new Point(i,  Math.Sin(((2*Math.PI )/ b) * (i - windowbreedte)) * windowhoogte));
                //2,5 + 2,5 sin(2π / 9(x – 3))

            }

            line.Points = punten;

            //Lijn tekenen
            canvas.Children.Add(line);

        }
开发者ID:drummendejef,项目名称:.Net-Programmer-Solutions,代码行数:34,代码来源:MainWindow.xaml.cs


示例7: AddFunction

        public void AddFunction(IEnumerable<Point> points, Color color, string description)
        {
            if(!squaresFunctions.ContainsKey(description) && !functions.ContainsKey(description))
            {
                Polyline polyline = new Polyline();
                polyline.Stroke = new SolidColorBrush(color);
                polyline.StrokeThickness = CalculateThickness(0.005, R2.Width, R2.Height);
                PointCollection pColl = new PointCollection(points);
                polyline.Points = pColl;


                var nwFour = new Four(polyline.Points.Min(p => p.X), polyline.Points.Max(p => p.Y),
                    polyline.Points.Min(p => p.Y), polyline.Points.Max(p => p.Y));
           
                squaresFunctions.Add(description, nwFour);

                RecalculateSquare();
                GoToCenter();
                DrowCoordinates();

                R2.Children.Add(polyline);

                Label lbl = new Label();
                lbl.Content = description;
                lbl.Foreground = new SolidColorBrush(color);
                Descriptions.Children.Add(lbl);

                functions.Add(description, new Tuple<Polyline, Label>(polyline, lbl));
            }
        }
开发者ID:kokushkin,项目名称:TestRepository,代码行数:30,代码来源:GraficControl.xaml.cs


示例8: LineGraph

    /// <summary>
    /// Instantiates LineGraph.
    /// </summary>
    public LineGraph() {
      this.DefaultStyleKey = typeof(LineGraph);
      _lineGraph = new Polyline();

      BindBrush();
      BindStrokeThickness();
    }
开发者ID:Hitchhikrr,项目名称:IgooanaApp,代码行数:10,代码来源:LineGraph.cs


示例9: StatisticsLinesManager

        public StatisticsLinesManager()
        {
            Center = 200;
            MaxWidth = 1000;

            _WinningsStatisticsLine = new System.Windows.Shapes.Polyline
            {
                StrokeThickness = 2,
                Stroke = Brushes.Red,
                Visibility = Visibility.Collapsed
            };

            _NumberRepetitionsLine = new System.Windows.Shapes.Polyline
            {
                StrokeThickness = 2,
                Stroke = Brushes.Blue,
                Visibility = Visibility.Collapsed
            };

            _NumberRepetitions2Line = new System.Windows.Shapes.Polyline
            {
                StrokeThickness = 2,
                Stroke = Brushes.Red,
                Visibility = Visibility.Collapsed
            };
        }
开发者ID:pedone,项目名称:CasinoRobot,代码行数:26,代码来源:StatisticsLinesManager.cs


示例10: addBorder

 private void addBorder(object sender, RoutedEventArgs e)
 {
     try
     {
         Polyline border = new Polyline();
         string[] points = borderTextBox.Text.Split('\n');
         string[] xAndY = new string[2];
         List<Double> xOfPoint = new List<Double>();
         List<Double> yOfPoint = new List<Double>();
         for (int i = 0; i < points.Length; i++)
         {
             xAndY = points[i].Split(',');
             xOfPoint.Add(Convert.ToDouble(xAndY[0]));
             yOfPoint.Add(Convert.ToDouble(xAndY[1]));
             border.Points.Add(new Point(xOfPoint[i], yOfPoint[i]));
         }
         border.Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0));
         border.Name = "border";
         MainWindow.polylineList.Add(border);
         var mainWindowInstant = (MainWindow)App.Current.MainWindow;
         mainWindowInstant.getCanvas.Children.Add(border);
         mainWindowInstant.reprintItemList();
         borderTextBox.Clear();
     }
     catch { }
 }
开发者ID:IAmTheBritton,项目名称:Project5-2,代码行数:26,代码来源:addWindow.xaml.cs


示例11: Computing

        public Computing()
        {
            Result = new Moment(0);
            //Tmr = new Timer(3000);
            //Tmr.AutoReset = true;
            //Tmr.Elapsed += Tmr_Elapsed;

            InpFileName = @"D:\ballistics\ballisticwpf\config.txt";
            OutFileName = @"D:\ballistics\ballisticwpf\result.txt";

            //string InpFileName = @"C:\Users\Andrey\Documents\Visual Studio 2015\Projects\ballistics\ballisticwpf\config.txt";
            //string OutFileName = @"C:\Users\Andrey\Documents\Visual Studio 2015\Projects\ballistics\ballisticwpf\result.txt";
            Config = new Configuration(0);
            Config.ReadConfugurationFromFile(InpFileName);

            bool ExistFlag = File.Exists(OutFileName);
            if (ExistFlag)
            {
                File.Delete(OutFileName);
            }

            Positions = new PointCollection();
            Positions.Add(new Point(0, 0));

            Chart = new Polyline();
            Chart.Points = Positions;

            //BgrWork = ((BackgroundWorker)this.FindResource("bgrWork"));
            //ComplexArg = new ComplexForAsyns(Config);
        }
开发者ID:parshikov-a,项目名称:ballistics,代码行数:30,代码来源:Computing.xaml.cs


示例12: OnNavigatedTo

 protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
     jolidessin = new Polyline();
     (App.Current as App).drawlist.Add(jolidessin);
     jolidessin.Stroke = this.Resources["PhoneForegroundBrush"] as Brush;
     jolidessin.StrokeThickness = (double)5;
      	        base.OnNavigatedTo(e);
 }
开发者ID:gabrielhan,项目名称:Wphone,代码行数:8,代码来源:Page1.xaml.cs


示例13: GetBodySegment

 public Polyline GetBodySegment(JointCollection joints, Brush brush, params JointType[] ids)
 {
     var points = new PointCollection(ids.Length);
     foreach (var t in ids)
         points.Add(GetDisplayPosition(joints[t]));
     var polyline = new Polyline { Points = points, Stroke = brush, StrokeThickness = 6 };
     return polyline;
 }
开发者ID:petkus09,项目名称:KTU-Cplusplus,代码行数:8,代码来源:KinectCanvas.cs


示例14: DataSeries

 public DataSeries()
 {
     LineSeries = new Polyline();
     LineThickness = 1;
     SeriesName = "Default Name";
     LineColor = Brushes.Black;
     Symbols = new NoneSymbols();
 }
开发者ID:ouyh18,项目名称:LteTools,代码行数:8,代码来源:DataSeries.cs


示例15: switch

 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.polyline1 = ((System.Windows.Shapes.Polyline)(target));
     return;
     }
     this._contentLoaded = true;
 }
开发者ID:LuckyLuik,项目名称:_GLDNBT,代码行数:9,代码来源:SpectrumAnalyser.g.i.cs


示例16: PolyLineHandleGroup

        public PolyLineHandleGroup(MoonlightController controller, Polyline child)
            : base(controller, child)
        {
            PointCollection points = child.Points;
            for (int i=0; i<points.Count; i++)
                AddHandle(new PolyLineHandle(Controller, this, i));

            Update();
        }
开发者ID:mono,项目名称:lunareclipse,代码行数:9,代码来源:PolyLineHandleGroup.cs


示例17: ConfigurePolyLine

 private void ConfigurePolyLine()
 {
     f_polyLine = new Polyline
     {
         StrokeThickness = (double)GraphicContent.GraphicToolProperties.Thickness,
         Stroke = new SolidColorBrush((Color)GraphicContent.GraphicToolProperties.Color),
         Effect = DropShadowEffect()
     };
 }
开发者ID:msCube,项目名称:Gallery,代码行数:9,代码来源:BrushTool.cs


示例18: SoundPlay

 private void SoundPlay(WaveOut waveOut, BinauralBeatsWaveOscillator wave, Polyline line, int leftFrequency, int rightFrequency, short amplitude)
 {
     double volumeGainFactor = 0.01;
     waveOut.Volume = (float)(amplitudeSlider.Value * volumeGainFactor);
     wave.LeftFrequency = leftFrequency;
     wave.RightFrequency = rightFrequency;
     wave.Amplitude = amplitude;
     waveOut.Play();
     waveGraphDrawing(line, wave, waveOut);
 }
开发者ID:juyingnan,项目名称:VS,代码行数:10,代码来源:MainWindow.xaml.cs


示例19: InitializeComponent

 public void InitializeComponent() {
     if (_contentLoaded) {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/EcosCab;component/Controls/ucLocomotiveSpeedSlider.xaml", System.UriKind.Relative));
     this.pnlSlider = ((System.Windows.Controls.Grid)(this.FindName("pnlSlider")));
     this.sliderBack = ((System.Windows.Shapes.Polyline)(this.FindName("sliderBack")));
     this.sliderFill = ((System.Windows.Shapes.Polyline)(this.FindName("sliderFill")));
 }
开发者ID:KonstantinKolesnik,项目名称:EcosHub,代码行数:10,代码来源:ucLocomotiveSpeedSlider.g.i.cs


示例20: Create

 public Polyline Create(IEnumerable<Point> points)
 {
     Polyline polyline = new Polyline
     {
         Stroke = Brush,
         StrokeThickness = _brushThickness,
         Opacity = _opacity,
         Points = new PointCollection(points)
     };
     return polyline;
 }
开发者ID:SergeyValavin,项目名称:MultiObjectiveOpitimzation,代码行数:11,代码来源:PolylineCreator.cs



注:本文中的System.Windows.Shapes.Polyline类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Shapes.Rectangle类代码示例发布时间:2022-05-26
下一篇:
C# Shapes.Polygon类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap