Class PolygonF
Represents a 2D polygon composed of single-precision floating-vertex vertices.
Inheritance
Namespace: X10D.Drawing
Assembly: X10D.dll
Syntax
public class PolygonF : object
Constructors
| Improve this Doc View SourcePolygonF()
Initializes a new instance of the PolygonF class.
Declaration
public PolygonF()
PolygonF(IEnumerable<PointF>)
Initializes a new instance of the PolygonF class by constructing it from the specified vertices.
Declaration
public PolygonF(IEnumerable<PointF> vertices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<PointF> | vertices | An enumerable collection of vertices from which the polygon should be constructed. |
PolygonF(IEnumerable<Vector2>)
Initializes a new instance of the PolygonF class by constructing it from the specified vertices.
Declaration
public PolygonF(IEnumerable<Vector2> vertices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Vector2> | vertices | An enumerable collection of vertices from which the polygon should be constructed. |
PolygonF(PolygonF)
Initializes a new instance of the PolygonF class by copying the specified polygon.
Declaration
public PolygonF(PolygonF polygon)
Parameters
Type | Name | Description |
---|---|---|
PolygonF | polygon |
Properties
| Improve this Doc View SourceEmpty
Gets an empty polygon. That is, a polygon with no vertices.
Declaration
public static PolygonF Empty { get; }
Property Value
Type | Description |
---|---|
PolygonF | An empty polygon. |
IsConvex
Returns a value indicating whether this polygon is convex.
Declaration
public bool IsConvex { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if this polygon is convex; otherwise, false. |
VertexCount
Gets the number of vertices in this polygon.
Declaration
public int VertexCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 | An |
Vertices
Gets a read-only view of the vertices in this polygon.
Declaration
public IReadOnlyList<PointF> Vertices { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<PointF> | A |
Methods
| Improve this Doc View SourceAddVertex(PointF)
Adds a vertex to this polygon.
Declaration
public void AddVertex(PointF vertex)
Parameters
Type | Name | Description |
---|---|---|
PointF | vertex | The vertex to add. |
AddVertex(Vector2)
Adds a vertex to this polygon.
Declaration
public void AddVertex(Vector2 vertex)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | vertex | The vertex to add. |
AddVertices(IEnumerable<PointF>)
Adds a collection of vertices to this polygon.
Declaration
public void AddVertices(IEnumerable<PointF> vertices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<PointF> | vertices | An enumerable collection of vertices to add. |
AddVertices(IEnumerable<Vector2>)
Adds a collection of vertices to this polygon.
Declaration
public void AddVertices(IEnumerable<Vector2> vertices)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Vector2> | vertices | An enumerable collection of vertices to add. |
ClearVertices()
Clears all vertices from this polygon.
Declaration
public void ClearVertices()
Equals(Nullable<Object>)
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Object> | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(PolygonF)
Returns a value indicating whether this instance and another instance are equal.
Declaration
public bool Equals(PolygonF other)
Parameters
Type | Name | Description |
---|---|---|
PolygonF | other | The instance with which to compare. |
Returns
Type | Description |
---|---|
System.Boolean | true if this instance and |
FromPolygon(Polygon)
Declaration
public static PolygonF FromPolygon(Polygon polygon)
Parameters
Type | Name | Description |
---|---|---|
Polygon | polygon | The polygon to convert. |
Returns
Type | Description |
---|---|
PolygonF | The converted polygon. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Operators
| Improve this Doc View SourceEquality(PolygonF, PolygonF)
Returns a value indicating whether two instances of PolygonF are equal.
Declaration
public static bool operator ==(PolygonF left, PolygonF right)
Parameters
Type | Name | Description |
---|---|---|
PolygonF | left | The first instance. |
PolygonF | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Implicit(Polygon to PolygonF)
Declaration
public static implicit operator PolygonF(Polygon polygon)
Parameters
Type | Name | Description |
---|---|---|
Polygon | polygon | The polygon to convert. |
Returns
Type | Description |
---|---|
PolygonF | The converted polygon. |
Inequality(PolygonF, PolygonF)
Returns a value indicating whether two instances of PolygonF are not equal.
Declaration
public static bool operator !=(PolygonF left, PolygonF right)
Parameters
Type | Name | Description |
---|---|---|
PolygonF | left | The first instance. |
PolygonF | right | The second instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |