예제 #1
0
        // -----------------------
        // Public Constructors
        // -----------------------

        /// <summary>
        ///	RectangleF Constructor
        /// </summary>
        ///
        /// <remarks>
        ///	Creates a RectangleF_ from PointF and SizeF values.
        /// </remarks>

        public RectangleF_(PointF_ location, SizeF_ size)
        {
            x      = location.X;
            y      = location.Y;
            width  = size.Width;
            height = size.Height;
        }
예제 #2
0
        /// <summary>
        ///	Ceiling Shared Method
        /// </summary>
        ///
        /// <remarks>
        ///	Produces a Point structure from a PointF structure by
        ///	taking the ceiling of the X and Y properties.
        /// </remarks>

        public static Point_ Ceiling(PointF_ value)
        {
            int x, y;

            checked {
                x = (int)Math.Ceiling(value.X);
                y = (int)Math.Ceiling(value.Y);
            }

            return(new Point_(x, y));
        }
예제 #3
0
        /// <summary>
        ///	Truncate Shared Method
        /// </summary>
        ///
        /// <remarks>
        ///	Produces a Point structure from a PointF structure by
        ///	truncating the X and Y properties.
        /// </remarks>

        // LAMESPEC: Should this be floor, or a pure cast to int?

        public static Point_ Truncate(PointF_ value)
        {
            int x, y;

            checked {
                x = (int)value.X;
                y = (int)value.Y;
            }

            return(new Point_(x, y));
        }
예제 #4
0
        /// <summary>
        ///	Round Shared Method
        /// </summary>
        ///
        /// <remarks>
        ///	Produces a Point structure from a PointF structure by
        ///	rounding the X and Y properties.
        /// </remarks>

        public static Point_ Round(PointF_ value)
        {
            int x, y;

            checked {
                x = (int)Math.Round(value.X);
                y = (int)Math.Round(value.Y);
            }

            return(new Point_(x, y));
        }
예제 #5
0
        public bool IsVisible(PointF_ point)
        {
            bool result;

            Status status = GDIPlus.GdipIsVisibleRegionPoint(nativeRegion, point.X, point.Y,
                                                             IntPtr.Zero, out result);

            GDIPlus.CheckStatus(status);

            return(result);
        }
예제 #6
0
        public bool IsVisible(PointF_ point, Graphics g)
        {
            IntPtr ptr = (g == null) ? IntPtr.Zero : g.NativeObject;
            bool   result;

            Status status = GDIPlus.GdipIsVisibleRegionPoint(nativeRegion, point.X, point.Y,
                                                             ptr, out result);

            GDIPlus.CheckStatus(status);

            return(result);
        }
예제 #7
0
        /// <summary>
        ///	Offset Method
        /// </summary>
        ///
        /// <remarks>
        ///	Moves the RectangleF_ a specified distance.
        /// </remarks>

        public void Offset(PointF_ pos)
        {
            Offset(pos.X, pos.Y);
        }
예제 #8
0
        /// <summary>
        ///	Contains Method
        /// </summary>
        ///
        /// <remarks>
        ///	Checks if a Point lies within this RectangleF.
        /// </remarks>

        public bool Contains(PointF_ pt)
        {
            return(Contains(pt.X, pt.Y));
        }
예제 #9
0
 public static PointF_ Subtract(PointF_ pt, SizeF_ sz)
 {
     return(new PointF_(pt.X - sz.Width, pt.Y - sz.Height));
 }
예제 #10
0
 public static PointF_ Add(PointF_ pt, SizeF_ sz)
 {
     return(new PointF_(pt.X + sz.Width, pt.Y + sz.Height));
 }
예제 #11
0
        // -----------------------
        // Public Constructors
        // -----------------------

        /// <summary>
        ///	SizeF Constructor
        /// </summary>
        ///
        /// <remarks>
        ///	Creates a SizeF from a PointF value.
        /// </remarks>

        public SizeF_(PointF_ pt)
        {
            width  = pt.X;
            height = pt.Y;
        }