Пример #1
0
        /// <summary> Clips graphics using the given Clip scene.
        ///
        /// </summary>
        /// <param name="clipScene">the scene node that is used for clipping.
        /// </param>
        public virtual void ClipTo(SceneNode clipScene)
        {
            SceneClip clip = new SceneClip(clipScene);

            state.scene.add(clip);
            state.scene = clip;
        }
Пример #2
0
        /// <summary> Clips to the area inside the current path.</summary>
        public virtual void Clip()
        {
            FilledPath shape = new FilledPath(path.createPath());
            SceneClip  clip  = new SceneClip(shape);

            state.scene.add(clip);
            state.scene = clip;

            path = new PathBuilder();
        }
Пример #3
0
        private SceneNode createNode(SceneShape shape, ScenicColor color, SceneNode brush)
        {
            if (color != null)
            {
                shape.Color = color;

                return(shape);
            }
            else
            {
                SceneClip sc = new SceneClip(shape);

                sc.add(brush);

                return(sc);
            }
        }
Пример #4
0
        /// <summary> Draws the given glyphs using the current font, Fill color and
        /// other settings. The positions of the glyphs are given
        /// as an array of floats. Each position is given as two
        /// numbers the x-position and y-position.
        ///
        /// </summary>
        /// <param name="glyphCodes">the glyph codes.
        /// </param>
        /// <param name="positions">the positions of the characters.
        /// </param>
        public virtual void drawGlyphs(int[] glyphCodes, float[] positions)
        {
            System.Drawing.Drawing2D.Matrix temp_Matrix;
            temp_Matrix = new System.Drawing.Drawing2D.Matrix();
            temp_Matrix.Translate((float)state.textPosition[0], (float)state.textPosition[1]);
            SceneTransform st        = new SceneTransform(temp_Matrix);
            TextShape      textShape = new TextShape(state.font, glyphCodes, positions);

            state.scene.add(st);

            if (state.fillColor != null)
            {
                textShape.Color = state.fillColor;
                st.add(textShape);
            }
            else
            {
                SceneClip sc = new SceneClip(textShape);

                sc.add(state.fillBrush);
                st.add(sc);
            }
        }