コード例 #1
0
        public void Border(Math.Border border)
        {
            Draw.border = border;
            StreamGeometry geometry = new StreamGeometry();

            if (border.DotCount == 0)
            {
                return;
            }
            using (StreamGeometryContext ctx = geometry.Open())
            {
                int i = 1;
                ctx.BeginFigure(new Point(border.get(0).X, border.get(0).Y), true, true);
                for (; i < border.DotCount - 1; i++)
                {
                    ctx.LineTo(new Point(border.get(i).X, border.get(i).Y), true, false);
                }
                ctx.LineTo(new Point(border.get(i).X, border.get(i).Y), false, false);
            }
            Path path = new Path();

            //path.Stroke = Brushes.Black;
            path.Fill = Brushes.Red;
            //path.StrokeThickness = 1;
            path.Data = geometry;
            graph.Children.Add(path);
            Appear(border.fetchLog());
        }
コード例 #2
0
        public void Lines(Math.Border border)
        {
            Draw.border = border;
            int  i = 0;
            Line myline;
            int  count = border.DotCount;

            for (; i < count; i++)
            {
                myline = myline = new Line();
                if (i == 0)
                {
                    Ring(border.get(i));
                    myline.Stroke = Brushes.Brown;
                }
                else
                {
                    myline.Stroke = Brushes.Red;
                }
                switch (border.getDotType(i))
                {
                case Product2.Test.Math.DrawType.normal:
                case Product2.Test.Math.DrawType.Emphasize:
                case Product2.Test.Math.DrawType.Error:
                case Product2.Test.Math.DrawType.Info:
                    break;

                case Product2.Test.Math.DrawType.Ignore:
                    Dot(border.get(i));
                    //myline.Stroke = Brushes.br;
                    break;

                default:
                    break;
                }

                myline.X1 = border.get(i).X;
                myline.Y1 = border.get(i).Y;
                myline.X2 = border.get(i + 1).X;
                myline.Y2 = border.get(i + 1).Y;
                graph.Children.Add(myline);
            }
            //StreamGeometry geometry = new StreamGeometry();
            //if (border.DotCount == 0)
            //{
            //    return;
            //}

            //using (StreamGeometryContext ctx = geometry.Open())
            //{
            //    int i = 1;
            //    ctx.BeginFigure(new Point(border.get(0).X, border.get(0).Y), true, true);
            //    for (; i < border.DotCount - 1; i++)
            //    {
            //        ctx.LineTo(new Point(border.get(i).X, border.get(i).Y), true, false);
            //    }
            //    ctx.LineTo(new Point(border.get(i).X, border.get(i).Y), false, false);
            //}
            //Path path = new Path();
            //path.Stroke = Brushes.Black;
            //path.StrokeThickness = 1;
            //path.Data = geometry;
            //graph.Children.Add(path);

            Appear(border.fetchLog());
        }