当前位置: 首页>>代码示例>>C#>>正文


C# IShape.GetPathIterator方法代码示例

本文整理汇总了C#中IShape.GetPathIterator方法的典型用法代码示例。如果您正苦于以下问题:C# IShape.GetPathIterator方法的具体用法?C# IShape.GetPathIterator怎么用?C# IShape.GetPathIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IShape的用法示例。


在下文中一共展示了IShape.GetPathIterator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Area

 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * The <code>Area</code> class creates an area geometry from the
  * specified {@link IShape} object.  The geometry is explicitly
  * closed, if the <code>IShape</code> is not already closed.  The
  * fill rule (even-odd or winding) specified by the geometry of the
  * <code>IShape</code> is used to determine the resulting enclosed area.
  * @param s  the <code>IShape</code> from which the area is constructed
  * @throws NullPointerException if <code>s</code> is null
  */
 public Area(IShape s)
 {
     if (s is Area)
     {
         _curves = ((Area)s)._curves;
     }
     else
     {
         _curves = PathToCurves(s.GetPathIterator(null));
     }
 }
开发者ID:237rxd,项目名称:maptiledownloader,代码行数:26,代码来源:Area.cs

示例2: ToSVG

        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 13JUN2009  James Shen                 	          Initial Creation
        ////////////////////////////////////////////////////////////////////////////
        /**
         * To a SVG string.
         * @param shape the shape object.
         * @return a SVG string
         */
        public static String ToSVG(IShape shape)
        {
            PathIterator pathIterator = shape.GetPathIterator(null);
            StringBuilder svgString = new StringBuilder("<path d='");
            int[] coords = new int[6];
            int type;
            while (!pathIterator.IsDone())
            {
                type = pathIterator.CurrentSegment(coords);
                switch (type)
                {
                    case PathIterator.SEG_CLOSE:
                        svgString.Append("Z ");
                        break;
                    case PathIterator.SEG_CUBICTO:
                        svgString.Append("C ");
                        svgString.Append(coords[0] + " ");
                        svgString.Append(coords[1] + " ");
                        svgString.Append(coords[2] + " ");
                        svgString.Append(coords[3] + " ");
                        svgString.Append(coords[4] + " ");
                        svgString.Append(coords[5]);
                        break;
                    case PathIterator.SEG_LINETO:
                        svgString.Append("L ");
                        svgString.Append(coords[0] + " ");
                        svgString.Append(coords[1]);
                        break;
                    case PathIterator.SEG_MOVETO:
                        svgString.Append("M ");
                        svgString.Append(coords[0] + " ");
                        svgString.Append(coords[1]);
                        break;
                    case PathIterator.SEG_QUADTO:
                        svgString.Append("Q ");
                        svgString.Append(coords[0] + " ");
                        svgString.Append(coords[1] + " ");
                        svgString.Append(coords[2] + " ");
                        svgString.Append(coords[3]);
                        break;
                }

                pathIterator.Next();

            }
            svgString.Append("' />");
            return svgString.ToString();
        }
开发者ID:237rxd,项目名称:maptiledownloader,代码行数:59,代码来源:Path.cs

示例3: Append

 ////////////////////////////////////////////////////////////////////////////
 //--------------------------------- REVISIONS ------------------------------
 // Date       Name                 Tracking #         Description
 // ---------  -------------------  -------------      ----------------------
 // 13JUN2009  James Shen                 	          Initial Creation
 ////////////////////////////////////////////////////////////////////////////
 /**
  * Appends the geometry of the specified {@code IShape} object to the
  * path, possibly connecting the new geometry to the existing path
  * segments with a line segment.
  * If the {@code connect} parameter is {@code true} and the
  * path is not empty then any initial {@code moveTo} in the
  * geometry of the appended {@code IShape}
  * is turned into a {@code lineTo} segment.
  * If the destination coordinates of such a connecting {@code lineTo}
  * segment match the ending coordinates of a currently open
  * subpath then the segment is omitted as superfluous.
  * The winding rule of the specified {@code IShape} is ignored
  * and the appended geometry is governed by the winding
  * rule specified for this path.
  *
  * @param s the {@code IShape} whose geometry is appended
  *          to this path
  * @param connect a bool to control whether or not to turn an initial
  *                {@code moveTo} segment into a {@code lineTo} segment
  *                to connect the new geometry to the existing path
  */
 public void Append(IShape s, bool connect)
 {
     Append(s.GetPathIterator(null), connect);
 }
开发者ID:237rxd,项目名称:maptiledownloader,代码行数:31,代码来源:Path.cs

示例4: Path

        ////////////////////////////////////////////////////////////////////////////
        //--------------------------------- REVISIONS ------------------------------
        // Date       Name                 Tracking #         Description
        // ---------  -------------------  -------------      ----------------------
        // 13JUN2009  James Shen                 	          Initial Creation
        ////////////////////////////////////////////////////////////////////////////
        /**
         * Constructs a new int precision {@code Path} object
         * from an arbitrary {@link IShape} object, transformed by an
         * {@link AffineTransform} object.
         * All of the initial geometry and the winding rule for this path are
         * taken from the specified {@code IShape} object and transformed
         * by the specified {@code AffineTransform} object.
         *
         * @param s the specified {@code IShape} object
         * @param at the specified {@code AffineTransform} object
         */
        public Path(IShape s, AffineTransform at)
        {
            if (s is Path)
            {
                Path p2D = (Path)s;
                SetWindingRule(p2D._windingRule);
                _numTypes = p2D._numTypes;
                _pointTypes = new byte[p2D._pointTypes.Length];
                Array.Copy(p2D._pointTypes, _pointTypes, _pointTypes.Length);

                _numCoords = p2D._numCoords;
                _intCoords = p2D.CloneCoords(at);
            }
            else
            {
                PathIterator pi = s.GetPathIterator(at);
                SetWindingRule(pi.GetWindingRule());
                _pointTypes = new byte[INIT_SIZE];
                _intCoords = new int[INIT_SIZE * 2];
                Append(pi, false);
            }
        }
开发者ID:237rxd,项目名称:maptiledownloader,代码行数:39,代码来源:Path.cs


注:本文中的IShape.GetPathIterator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。