コード例 #1
0
        public static void QuadToCubic(IPathRender output, PointF cur, PointF c1, PointF pt)
        {
            float xctrl1 = c1.X + (cur.X - c1.X) / 3f;
            float yctrl1 = c1.Y + (cur.Y - c1.Y) / 3f;
            float xctrl2 = c1.X + (pt.X - c1.X) / 3f;
            float yctrl2 = c1.Y + (pt.Y - c1.Y) / 3f;

            output.Cubic(cur, new PointF(xctrl1, yctrl1), new PointF(xctrl2, yctrl2), pt);
        }
コード例 #2
0
        static void Cubic(IPathRender output, PathRenderFeatures features, PointF cur, PointF c1, PointF c2,
                          PointF pt, float resolution)
        {
            if ((features & PathRenderFeatures.Cubic) != 0)
            {
                output.Cubic(cur, c1, c2, pt);
                return;
            }

            if ((features & PathRenderFeatures.Quad) != 0)
            {
                CubicToQuad(output, cur, c1, c2, pt, resolution);
            }
            else
            {
                CubicToLine(output, cur, c1, c2, pt, 0.025);
            }
        }