Пример #1
0
 private void create_Box_Poly(focus_Box x)
 {
     boxpoly.Add(new Polyline()
     {
         Stroke          = red_bright_button_brush,
         StrokeThickness = 3
     });
     Plotter_canvas.Children.Add(boxpoly[boxpoly.Count - 1]);
     boxpoly[boxpoly.Count - 1].Points.Add(new Point(x.x1, x.y1));
     boxpoly[boxpoly.Count - 1].Points.Add(new Point(x.x2, x.y2));
     boxpoly[boxpoly.Count - 1].Points.Add(new Point(x.x3, x.y3));
     boxpoly[boxpoly.Count - 1].Points.Add(new Point(x.x4, x.y4));
     boxpoly[boxpoly.Count - 1].Points.Add(new Point(x.x1, x.y1));
 }
Пример #2
0
 private void create_Box_Button(focus_Box x)
 {
     Box_bt.Add(new Button()
     {
         Width  = x.x2 - x.x1,
         Height = x.y3 - x.y1,
         HorizontalAlignment = HorizontalAlignment.Stretch,
         VerticalAlignment   = VerticalAlignment.Stretch,
         Background          = Transparent_brush,
         FontSize            = 16,
         Foreground          = Light_blue_brush,
         Content             = (boxpoly.Count).ToString()
     });
     Plotter_canvas.Children.Add(Box_bt[Box_bt.Count - 1]);
     Canvas.SetLeft(Box_bt[Box_bt.Count - 1], x.x1);
     Canvas.SetTop(Box_bt[Box_bt.Count - 1], x.y1);
 }
Пример #3
0
        private void Create_Box_Gon(focus_Box b)
        {
            int    i         = 0;
            double x         = 0;
            double y         = 0;
            int    xmax      = (int)(Input_Data_Point.Count * b.x2 / Width);
            int    xmin      = (int)(Input_Data_Point.Count * b.x1 / Width);
            bool   flag      = false;
            bool   crossflag = false;

            #region Input Freq
            Box_gon.Add(new Polygon()
            {
                Stroke          = Light_blue_brush,
                StrokeThickness = 1,
                Fill            = Violet_Red
            });

            i = xmin;
            while (i < (xmax + 1))
            {
                if (Input_Data_Line[Input_Data_Line.Count - 1].Points[i].Y > b.y3)
                {
                    if (flag)
                    {
                        xmax = i;
                        flag = !flag;
                        break;
                    }
                    else
                    {
                        xmin = i;
                    }

                    crossflag = true;
                }
                else
                {
                    if (!flag)
                    {
                        flag = !flag;
                    }

                    Box_gon[Box_gon.Count - 1].Points.Add(Input_Data_Line[Input_Data_Line.Count - 1].Points[i]);
                }
                i++;
            }
            if (crossflag)
            {
                Box_gon[Box_gon.Count - 1].Points.Add(Box_gon[Box_gon.Count - 1].Points[0]);
            }
            else
            {
                Box_gon[Box_gon.Count - 1].Points.Add(new Point(b.x3, b.y3));
                Box_gon[Box_gon.Count - 1].Points.Add(new Point(b.x4, b.y4));
                Box_gon[Box_gon.Count - 1].Points.Add(new Point(b.x1, b.y1));
            }
            Plotter_canvas.Children.Add(Box_gon[Box_gon.Count - 1]);


            #endregion
        }