Example #1
0
        public XGraphicsPath TransformGeom(double sf, Polygon geom, BoundingBox geomBox)
        {
            double        xmin = geomBox.Left;
            double        ymin = geomBox.Bottom;
            XGraphicsPath xgp  = new XGraphicsPath();
            int           i    = 0;

            XPoint[] listXPoints = new XPoint[geom.ExteriorRing.Vertices.Count];
            foreach (Point p in geom.ExteriorRing.Vertices)
            {
                //XPoint pCopy = new XPoint((p.X - xmin) * sf, -(p.Y - ymin) * sf);
                XPoint pCopy = TransformGeom(sf, p, geomBox);
                listXPoints[i++] = pCopy;
            }
            xgp.AddPolygon(listXPoints);

            foreach (LinearRing r in geom.InteriorRings)
            {
                i           = 0;
                listXPoints = new XPoint[r.Vertices.Count];
                foreach (Point p in r.Vertices)
                {
                    //XPoint pCopy = new XPoint((p.X - xmin) * sf, -(p.Y - ymin) * sf);
                    XPoint pCopy = TransformGeom(sf, p, geomBox);
                    listXPoints[i++] = pCopy;
                }
                xgp.AddPolygon(listXPoints);
            }
            return(xgp);
        }