// ----------------------- // 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; }
/// <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)); }
/// <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)); }
/// <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)); }
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); }
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); }
/// <summary> /// Offset Method /// </summary> /// /// <remarks> /// Moves the RectangleF_ a specified distance. /// </remarks> public void Offset(PointF_ pos) { Offset(pos.X, pos.Y); }
/// <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)); }
public static PointF_ Subtract(PointF_ pt, SizeF_ sz) { return(new PointF_(pt.X - sz.Width, pt.Y - sz.Height)); }
public static PointF_ Add(PointF_ pt, SizeF_ sz) { return(new PointF_(pt.X + sz.Width, pt.Y + sz.Height)); }
// ----------------------- // 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; }