コード例 #1
0
ファイル: Graphics.cs プロジェクト: andyhebear/mogregis3d
        /// <summary> Fills the current path.</summary>
        public virtual void Fill()
        {
            FilledPath shape = new FilledPath(path.createPath());

            shape.FillRule = state.fillRule;
            state.scene.add(createNode(shape, state.fillColor, state.fillBrush));

            path = new PathBuilder();
        }
コード例 #2
0
ファイル: Graphics.cs プロジェクト: andyhebear/mogregis3d
        /// <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
ファイル: Graphics.cs プロジェクト: andyhebear/mogregis3d
        /// <summary> Fills and strokes the current path.</summary>
        public virtual void FillAndStroke()
        {
            Path       p     = path.createPath();
            FilledPath shape = new FilledPath(p);

            shape.FillRule = state.fillRule;
            state.scene.add(createNode(shape, state.fillColor, state.fillBrush));

            StrokedPath r2 = new StrokedPath(p);

            r2.LineWidth  = state.lineWidth;
            r2.EndCap     = state.lineCap;
            r2.LineJoin   = state.lineJoin;
            r2.MiterLimit = state.miterLimit;

            state.scene.add(createNode(r2, state.strokeColor, state.strokeBrush));

            path = new PathBuilder();
        }
コード例 #4
0
        private void drawUsingPolygon(DrawContext context, System.Drawing.Drawing2D.Matrix transform, ScenicColor color)
        {
#if PENDING
            if (glyphPolygons == null)
            {
                glyphPolygons = new FilledPath[glyphCodes.Length];
                for (int i = 0; i < glyphCodes.Length; i++)
                {
                    System.Drawing.Drawing2D.Matrix temp_Matrix;
                    temp_Matrix = new System.Drawing.Drawing2D.Matrix();
                    temp_Matrix.Translate((float)positions[i * 2], (float)positions[i * 2 + 1]);
                    System.Drawing.Drawing2D.Matrix at = temp_Matrix;
                    //UPGRADE_TODO: Interface 'java.awt.Shape' was converted to 'System.Drawing.Drawing2D.GraphicsPath' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_3"'
                    System.Drawing.Drawing2D.GraphicsPath shape = TextRenderer.getGlyphOutline(font, at, glyphCodes[i]);
                    Path path = new AWTShapePath(shape);

                    glyphPolygons[i] = new FilledPath(path);
                }
            }

            System.Drawing.Drawing2D.Matrix temp = new System.Drawing.Drawing2D.Matrix();

            for (int i = 0; i < glyphPolygons.Length; i++)
            {
                System.Drawing.Drawing2D.Matrix temp_Matrix2;
                temp_Matrix2 = new System.Drawing.Drawing2D.Matrix();
                temp_Matrix2.Translate((float)positions[i * 2], (float)positions[i * 2 + 1]);
                System.Drawing.Drawing2D.Matrix at = temp_Matrix2;

                //UPGRADE_ISSUE: Method 'java.awt.geom.AffineTransform.setTransform' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtgeomAffineTransformsetTransform_javaawtgeomAffineTransform_3"'
                temp.setTransform(transform);
                //UPGRADE_TODO: Method 'java.awt.geom.AffineTransform.concatenate' was converted to 'System.Drawing.Drawing2D.Matrix.Multiply' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtgeomAffineTransformconcatenate_javaawtgeomAffineTransform_3"'
                temp.Multiply(at, System.Drawing.Drawing2D.MatrixOrder.Append);
                glyphPolygons[i].draw(context, temp, color);
            }
#endif
        }