TransformToImage() public method

Transforms the polygon to image coordinates, based on the map
public TransformToImage ( SharpMap map ) : System.Drawing.PointF[]
map SharpMap Map to base coordinates on
return System.Drawing.PointF[]
        protected override void OnRenderInternal(Map map, Polygon polygon, Graphics g)
        {
            // convert points
            var pts = /*LimitValues(*/polygon.TransformToImage(map)/*)*/;

            // clip
            if (UseClipping)
                pts = VectorRenderer.ClipPolygon(pts, map.Size.Width, map.Size.Height);
            
            // fill the polygon
            if (Fill != null)
                g.FillPolygon(Fill, pts);
            
            // outline the polygon
            if (Outline != null)
                g.DrawPolygon(Outline, pts);
        }
Example #2
0
 protected static GraphicsPath PolygonToGraphicsPath(Map map, Polygon polygon)
 {
     var gp = new GraphicsPath(FillMode.Alternate);
     gp.AddPolygon(polygon.TransformToImage(map));
     return gp;
 }