Struct PointF
Represents an ordered pair of floating-point x- and y-coordinates.
Implements
Inherited Members
Namespace: DRIT.Drawing.Geometry
Assembly: DRIT.Drawing.dll
Syntax
public struct PointF : IEquatable<PointF>
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Constructors
PointF(float, float)
Initializes a new PointF with the specified coordinates.
Declaration
public PointF(float x, float y)
Parameters
| Type | Name | Description |
|---|---|---|
| float | x | The x-coordinate. |
| float | y | The y-coordinate. |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Fields
Empty
Gets an empty PointF (0, 0).
Declaration
public static readonly PointF Empty
Field Value
| Type | Description |
|---|---|
| PointF |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
X
Gets or sets the x-coordinate.
Declaration
public float X
Field Value
| Type | Description |
|---|---|
| float |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Y
Gets or sets the y-coordinate.
Declaration
public float Y
Field Value
| Type | Description |
|---|---|
| float |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Properties
IsEmpty
Gets a value indicating whether this point is empty (0, 0).
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Methods
Add(PointF, SizeF)
Adds the specified point and size.
Declaration
public static PointF Add(PointF pt, SizeF sz)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | pt | The point to add to. |
| SizeF | sz | The size to add. |
Returns
| Type | Description |
|---|---|
| PointF | The resulting point. |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Equals(PointF)
Indicates whether this point is equal to another point.
Declaration
public bool Equals(PointF other)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | other | The point to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Equals(object?)
Indicates whether this point is equal to another object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare. |
Returns
| Type | Description |
|---|---|
| bool |
|
Overrides
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
GetHashCode()
Returns a hash code for this point.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The hash code. |
Overrides
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Offset(PointF)
Translates the point by the offsets of another point.
Declaration
public void Offset(PointF p)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | p | The point containing the offsets. |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Offset(float, float)
Translates the point by the specified offsets.
Declaration
public void Offset(float dx, float dy)
Parameters
| Type | Name | Description |
|---|---|---|
| float | dx | The horizontal offset. |
| float | dy | The vertical offset. |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Subtract(PointF, SizeF)
Subtracts the specified size from the point.
Declaration
public static PointF Subtract(PointF pt, SizeF sz)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | pt | The point to subtract from. |
| SizeF | sz | The size to subtract. |
Returns
| Type | Description |
|---|---|
| PointF | The resulting point. |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
ToString()
Returns a string representation of this point.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string in the format "{X=value, Y=value}". |
Overrides
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
Operators
operator +(PointF, SizeF)
Adds a point and a size.
Declaration
public static PointF operator +(PointF pt, SizeF sz)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | pt | |
| SizeF | sz |
Returns
| Type | Description |
|---|---|
| PointF |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
operator ==(PointF, PointF)
Compares two points for equality.
Declaration
public static bool operator ==(PointF left, PointF right)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | left | |
| PointF | right |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
operator !=(PointF, PointF)
Compares two points for inequality.
Declaration
public static bool operator !=(PointF left, PointF right)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | left | |
| PointF | right |
Returns
| Type | Description |
|---|---|
| bool |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.
operator -(PointF, SizeF)
Subtracts a size from a point.
Declaration
public static PointF operator -(PointF pt, SizeF sz)
Parameters
| Type | Name | Description |
|---|---|---|
| PointF | pt | |
| SizeF | sz |
Returns
| Type | Description |
|---|---|
| PointF |
Remarks
A PointF represents a location in a two-dimensional coordinate system. X and Y are public fields for performance reasons, matching the System.Drawing API.