コード例 #1
0
        public void FillPath(Loonim.TextureNode fill, VectorPath transformedPath, bool evenOddFillMethod)
        {
            // Create Loonim node:
            Loonim.CustomMesh path = new Loonim.CustomMesh(fill, transformedPath);

            // Add to draw stack:
            if (DrawStack == null)
            {
                DrawStack            = new Loonim.Stack(1);
                DrawStack.Sources[0] = path;
            }
            else
            {
                // Add a path to the draw stack:
                DrawStack.Add(path);
            }
        }
コード例 #2
0
        /// <summary>Computes a stroke path now and adds it.</summary>
        public void StrokePath(Loonim.TextureNode stroke, VectorPath transformedPath, float width, SVGElement settings)
        {
            if (StrokeHelper == null)
            {
                StrokeHelper = new Loonim.StrokePathMesh();
            }

            // Get other settings:
            StrokeHelper.LineCapMode = settings.StrokeLineCap;
            // Css.Value dashArray=settings.StrokeDashArray;
            StrokeHelper.LineJoinMode = settings.StrokeLineJoin;
            StrokeHelper.MiterLimit   = settings.StrokeMiterLimit;
            StrokeHelper.Accuracy     = Loonim.CustomMesh.DefaultAccuracy;
            StrokeHelper.Width        = width;

            // Generate now!
            List <Mesh> meshes = StrokeHelper.GenerateMeshes(transformedPath);

            foreach (Mesh mesh in meshes)
            {
                // Create Loonim node for each mesh:
                Loonim.CustomMesh path = new Loonim.CustomMesh(stroke, mesh);

                // Add to draw stack:
                if (DrawStack == null)
                {
                    DrawStack            = new Loonim.Stack(1);
                    DrawStack.Sources[0] = path;
                }
                else
                {
                    // Add a path to the draw stack:
                    DrawStack.Add(path);
                }
            }
        }