[]
Represents a rectangular area occupied by an embedded object.
public class ObjectRect
Initializes a new instance of the ObjectRect class.
public ObjectRect()
Initializes a new instance of the ObjectRect class from another instance of ObjectRect.
public ObjectRect(ObjectRect source)
source
ObjectRectInitializes a new instance of the ObjectRect class with the specified location and size.
public ObjectRect(PointF pt, SizeF sz)
pt
System.Drawing.PointFA System.Drawing.PointF that represents the upper-left corner of the rectangle.
sz
System.Drawing.SizeFA System.Drawing.SizeF that represents the size of the rectangle.
Initializes a new instance of the ObjectRect class from a System.Drawing.RectangleF.
public ObjectRect(RectangleF rc)
rc
System.Drawing.RectangleFThe rectangle used to initialize the new ObjectRect.
Initializes a new instance of the ObjectRect class with the specified coordinates and size.
public ObjectRect(float x, float y, float width, float height)
x
floatThe X coordinate of the rectangle.
y
floatThe Y coordinate of the rectangle.
width
floatThe width of the rectangle.
height
floatThe height of the rectangle.
Gets or sets the y-coordinate of the bottom edge of this ObjectRect, in graphic units.
public float Bottom { get; set; }
Gets or sets the height of this ObjectRect, in graphic units.
public float Height { get; set; }
Gets or sets the x-coordinate of the left edge of this ObjectRect, in graphic units.
public float Left { get; set; }
Gets or sets the x-coordinate of the right edge of this ObjectRect, in graphic units.
public float Right { get; set; }
Gets or sets the custom data associated with this ObjectRect.
public object Tag { get; set; }
Gets or sets the y-coordinate of the top edge of this ObjectRect, in graphic units.
public float Top { get; set; }
Gets or sets the width of this ObjectRect, in graphic units.
public float Width { get; set; }
Gets or sets the x-coordinate of the left edge of this ObjectRect, in graphic units.
public float X { get; set; }
Gets or sets the y-coordinate of the top edge of this ObjectRect, in graphic units.
public float Y { get; set; }
Determines if the specified point is contained within this rectangle.
public bool Contains(float x, float y)
x
floaty
floatCreates an instance of ObjectRect from (left, top, right, bottom) coordinates.
public static ObjectRect FromLTRB(float left, float top, float right, float bottom)
left
floatThe X coordinate of the top left corner.
top
floatThe Y coordinate of the top left corner.
right
floatThe X coordinate of the bottom right corner.
bottom
floatThe Y coordinate of the bottom right corner.
Inflates the rectangle by the specified amount.
public void Inflate(float dx, float dy)
dx
floatdy
floatDetermines if this rectangle intersects with rect
.
public bool IntersectsWith(ObjectRect rect)
rect
ObjectRectOffsets the rectangle by the specified amount.
public void Offset(float dx, float dy)
dx
floatdy
floatScales all coordinates of a rectangle by the specified scaleX and scaleY.
public void Scale(float scaleX, float scaleY)
scaleX
floatscaleY
floatScales all coordinates of a rectangle by the specified scaleFactor.
public void Scale(float scaleFactor)
scaleFactor
floatConverts an ObjectRect to System.Drawing.RectangleF.
public RectangleF ToRectangleF()
Performs an explicit conversion from ObjectRect to System.Drawing.RectangleF.
public static explicit operator RectangleF(ObjectRect rect)
rect
ObjectRectPerforms an explicit conversion from System.Drawing.RectangleF to ObjectRect.
public static explicit operator ObjectRect(RectangleF rc)
rc
System.Drawing.RectangleF