Beispiel #1
0
        /// <summary> Draw a convex polygon of the specific color and thickness </summary>
        /// <param name="polygon"> The convex polygon to be drawn</param>
        /// <param name="color"> The color of the convex polygon </param>
        /// <param name="thickness"> If thickness is less than 1, the triangle is filled up </param>
        public override void Draw(IConvexPolygonF polygon, TColor color, int thickness)
        {
            Point[] pts = Array.ConvertAll <PointF, Point>(
                polygon.GetVertices(),
                MapPointToImagePoint);

            if (thickness > 0)
            {
                base.DrawPolyline(pts, true, color, thickness);
            }
            else
            {
                base.FillConvexPoly(pts, color);
            }
        }
Beispiel #2
0
      ///<summary> Draw a convex polygon of the specific color and thickness </summary>
      ///<param name="polygon"> The convex polygon to be drawn</param>
      ///<param name="color"> The color of the convex polygon </param>
      ///<param name="thickness"> If thickness is less than 1, the triangle is filled up </param>
      public override void Draw(IConvexPolygonF polygon, TColor color, int thickness)
      {
         Point[] pts =
#if NETFX_CORE || NETSTANDARD1_4
            Extensions.
#else
            Array.
#endif
            ConvertAll<PointF, Point>(
            polygon.GetVertices(),
            MapPointToImagePoint);

         if (thickness > 0)
            base.DrawPolyline(pts, true, color, thickness);
         else
            base.FillConvexPoly(pts, color);
      }
Beispiel #3
0
        /// <summary> Draw a convex polygon of the specific color and thickness </summary>
        /// <param name="polygon"> The convex polygon to be drawn</param>
        /// <param name="color"> The color of the convex polygon </param>
        /// <param name="thickness"> If thickness is less than 1, the triangle is filled up </param>
        public override void Draw(IConvexPolygonF polygon, TColor color, int thickness)
        {
            PointF[] polygonVertices = polygon.GetVertices();

            Point[] pts = new Point[polygonVertices.Length];
            for (int i = 0; i < polygonVertices.Length; i++)
            {
                pts[i] = MapPointToImagePoint(polygonVertices[i]);
            }

            if (thickness > 0)
            {
                base.DrawPolyline(pts, true, color, thickness);
            }
            else
            {
                base.FillConvexPoly(pts, color);
            }
        }