[]
        
(Showing Draft Content)

GrapeCity.Documents.Common.Quadrilateral

Struct Quadrilateral

Namespace
GrapeCity.Documents.Common
Assembly
GcDocs.Imaging.dll

Represents a quadrilateral defined by its four vertices's.

public struct Quadrilateral : IEquatable<Quadrilateral>
Implements
System.IEquatable<T><Quadrilateral>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()

Constructors

Quadrilateral(PointF, PointF, PointF, PointF)

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)

Parameters

bottomLeft System.Drawing.PointF

The rectangle's bottom left corner.

topLeft System.Drawing.PointF

The rectangle's top left corner.

topRight System.Drawing.PointF

The rectangle's top right corner.

bottomRight System.Drawing.PointF

The rectangle's bottom right corner.

Quadrilateral(RectangleF)

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)

Parameters

rect System.Drawing.RectangleF

The rectangle.

Fields

A

The first vertex of the quadrilateral.

If initialized from a rectangle, corresponds to the rectangle's bottom left corner.

public PointF A

Field Value

System.Drawing.PointF

B

The second vertex of the quadrilateral.

If initialized from a rectangle, corresponds to the rectangle's top left corner.

public PointF B

Field Value

System.Drawing.PointF

C

The third vertex of the quadrilateral.

If initialized from a rectangle, corresponds to the rectangle's top right corner.

public PointF C

Field Value

System.Drawing.PointF

D

The fourth vertex of the quadrilateral.

If initialized from a rectangle, corresponds to the rectangle's bottom right corner.

public PointF D

Field Value

System.Drawing.PointF

Methods

Equals(Quadrilateral)

public bool Equals(Quadrilateral other)

Parameters

other Quadrilateral

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetArea()

Returns the area of the quadrilateral.

public float GetArea()

Returns

float

GetHashCode()

public override int GetHashCode()

Returns

int

Multiply(float, float)

Multiplies this Quadrilateral by the x and y.

public void Multiply(float x, float y)

Parameters

x float
y float

Offset(Quadrilateral, float, float)

Offsets all points of this Quadrilateral by the x and y.

public static Quadrilateral Offset(Quadrilateral q, float x, float y)

Parameters

q Quadrilateral
x float
y float

Returns

Quadrilateral

Offset(float, float)

Offsets all points of this Quadrilateral by the x and y.

public void Offset(float x, float y)

Parameters

x float
y float

ToRect()

Creates a System.Drawing.RectangleF structure that contains this Quadrilateral.

public RectangleF ToRect()

Returns

System.Drawing.RectangleF

The System.Drawing.RectangleF containing this Quadrilateral.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(Quadrilateral, Quadrilateral)

Tests whether two specified Quadrilateral objects are equivalent.

public static bool operator ==(Quadrilateral v1, Quadrilateral v2)

Parameters

v1 Quadrilateral
v2 Quadrilateral

Returns

bool

implicit operator Quadrilateral(RectangleF)

Converts a System.Drawing.RectangleF to Quadrilateral.

public static implicit operator Quadrilateral(RectangleF rect)

Parameters

rect System.Drawing.RectangleF

The rectangle to convert.

Returns

Quadrilateral

operator !=(Quadrilateral, Quadrilateral)

Tests whether two specified Quadrilateral objects are NOT equivalent.

public static bool operator !=(Quadrilateral v1, Quadrilateral v2)

Parameters

v1 Quadrilateral
v2 Quadrilateral

Returns

bool