Exemple #1
0
        public Shape TransShape(Shape s)
        {
            Shape ret = new Shape();
            int nPoint = s.Points.Count;
            for (int i = 0; i < nPoint; i++)
            {
                ret.Points.Add(TransPoint(s.Points[i]));
            }

            foreach (Shape s1 in s.GetShapes())
            {
                ret.AddNestedShape(TransShape(s1));
            }
            return ret;
        }
Exemple #2
0
        public static void Draw(Shape s, DrawParams dParams, bool fill = false)
        {
            if (fill)
            {
                Fill(s, dParams, dParams.FillBrush);
                foreach (Shape s2 in s.GetShapes())
                {
                    Draw(s2, dParams);
                    Fill(s2, dParams, new SolidBrush(Color.White));
                }
            }

            Point[] pArray = new Point[s.Points.Count];
            for (int i = 0; i < s.Points.Count; i++)
            {
                pArray[i] = dParams.Trans.TransPoint(s.Points[i]);
            }

            for (int i = 0; i < s.Points.Count; i++)
            {
                dParams.Graphics.DrawLine(dParams.Pen, pArray[i], pArray[(i + 1) % s.Points.Count]);
            }
        }