[]
Represents a quadrilateral defined by its four vertices's.
public struct Quadrilateral : IEquatable<Quadrilateral>
Initializes a new instance of the Quadrilateral struct from the four corners of a rectangle.
The vertices's of the quadrilateral correspond to the corners of the rectangle clockwise starting from the bottom left vertex.
public Quadrilateral(PointF bottomLeft, PointF topLeft, PointF topRight, PointF bottomRight)
bottomLeft System.Drawing.PointFThe rectangle's bottom left corner.
topLeft System.Drawing.PointFThe rectangle's top left corner.
topRight System.Drawing.PointFThe rectangle's top right corner.
bottomRight System.Drawing.PointFThe rectangle's bottom right corner.
Initializes a new instance of the Quadrilateral struct from a rectangle.
The vertices's of the quadrilateral correspond to the corners of the rectangle clockwise starting from the bottom left vertex.
public Quadrilateral(RectangleF rect)
rect System.Drawing.RectangleFThe rectangle.
The first vertex of the quadrilateral.
If initialized from a rectangle, corresponds to the rectangle's bottom left corner.
public PointF A
The second vertex of the quadrilateral.
If initialized from a rectangle, corresponds to the rectangle's top left corner.
public PointF B
The third vertex of the quadrilateral.
If initialized from a rectangle, corresponds to the rectangle's top right corner.
public PointF C
The fourth vertex of the quadrilateral.
If initialized from a rectangle, corresponds to the rectangle's bottom right corner.
public PointF D
public bool Equals(Quadrilateral other)
other Quadrilateralpublic override bool Equals(object obj)
obj objectReturns the area of the quadrilateral.
public float GetArea()
public override int GetHashCode()
Multiplies this Quadrilateral by the x and y.
public void Multiply(float x, float y)
x floaty floatOffsets all points of this Quadrilateral by the x and y.
public static Quadrilateral Offset(Quadrilateral q, float x, float y)
q Quadrilateralx floaty floatOffsets all points of this Quadrilateral by the x and y.
public void Offset(float x, float y)
x floaty floatCreates a System.Drawing.RectangleF structure that contains this Quadrilateral.
public RectangleF ToRect()
The System.Drawing.RectangleF containing this Quadrilateral.
public override string ToString()
Tests whether two specified Quadrilateral objects are equivalent.
public static bool operator ==(Quadrilateral v1, Quadrilateral v2)
v1 Quadrilateralv2 QuadrilateralConverts a System.Drawing.RectangleF to Quadrilateral.
public static implicit operator Quadrilateral(RectangleF rect)
rect System.Drawing.RectangleFThe rectangle to convert.
Tests whether two specified Quadrilateral objects are NOT equivalent.
public static bool operator !=(Quadrilateral v1, Quadrilateral v2)
v1 Quadrilateralv2 Quadrilateral