Represents a pair of single-precision floating point X and Y coordinates of a point on a 2-dimensional plane. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type. More...

Public Member Functions

 PointF ()
 Constructs a new PointF object and initializes its X and Y coordinates values with 0. More...
 
 PointF (float x, float y)
 Constructs a new PointF object and initializes it with the specified values. More...
 
 PointF (const SizeF &size)
 Constructs a new PointF object and initializes its X and Y coordinates values with the values of width and height of the specifide SizeF object correspondingly. More...
 
bool get_IsEmpty () const
 Determines if both X and Y coordinates values are equal to 0. More...
 
float get_X () const
 Returns the value of X coordinate represented by the current object. More...
 
float get_Y () const
 Returns the value of Y coordinate represented by the current object. More...
 
void set_X (float value)
 Sets the value of X coordinate represented by the current object. More...
 
void set_Y (float value)
 Sets the value of Y coordinate represented by the current object. More...
 
bool Equals (const PointF &point) const
 Determines if the current object and the specified object are equal, i.e. represent the same pair of X and Y coordinates values. More...
 
int GetHashCode () const
 Returns a hash code for the current object. More...
 
System::String ToString () const
 Returns the string representation of the pair of X and Y coordinates values represented by the current object. More...
 
bool IsNull () const
 Always returns false. More...
 
 operator bool ()
 Always returns true. More...
 

Static Public Member Functions

static PointF Add (const PointF &point, const SizeF &size)
 Adds the width and height values of the specified SizeF object to the X and Y coordinates values of the specified PointF object correspondingly. More...
 
static PointF Subtract (const PointF &point, const SizeF &size)
 Subtracts the width and height values of the specified SizeF object from the X and Y coordinates values of the specified PointF object correspondingly. More...
 
static PointF Add (const PointF &point, const Size &size)
 Adds the width and height values of the specified Size object to the X and Y coordinates values of the specified PointF object correspondingly. More...
 
static PointF Subtract (const PointF &point, const Size &size)
 Subtracts the width and height values of the specified Size object from the X and Y coordinates values of the specified PointF object correspondingly. More...
 

Static Public Attributes

static const PointF Empty
 An empty instance of PointF class whose X and Y coordinates values are 0. More...
 

Friends

PointF operator+ (const PointF &point, const SizeF &size)
 Adds the width and height values of the specified SizeF object to the X and Y coordinates values of the specified PointF object correspondingly. More...
 
PointF operator- (const PointF &point, const SizeF &size)
 Subtracts the width and height values of the specified SizeF object from the X and Y coordinates values of the specified PointF object correspondingly. More...
 
PointF operator+ (const PointF &point, const Size &size)
 Adds the width and height values of the specified Size object to the X and Y coordinates values of the specified PointF object correspondingly. More...
 
PointF operator- (const PointF &point, const Size &size)
 Subtracts the width and height values of the specified Size object from the X and Y coordinates values of the specified PointF object correspondingly. More...
 
bool operator== (const PointF &point1, const PointF &point2)
 Determines if the specified PointF objects are equal, i.e. represent the same pair of X and Y coordinates values. More...
 
bool operator!= (const PointF &point1, const PointF &point2)
 Determines if the specified PointF objects are not equal, i.e. represent the distinct pairs of X and Y coordinates values. More...
 
bool operator< (const PointF &point1, const PointF &point2)
 Always throws InvalidOperationException. More...
 

Detailed Description

Represents a pair of single-precision floating point X and Y coordinates of a point on a 2-dimensional plane. This type should be allocated on stack and passed to functions by value or by reference. Never use System::SmartPtr class to manage objects of this type.

Constructor & Destructor Documentation

◆ PointF() [1/3]

System::Drawing::PointF::PointF ( )

Constructs a new PointF object and initializes its X and Y coordinates values with 0.

◆ PointF() [2/3]

System::Drawing::PointF::PointF ( float  x,
float  y 
)

Constructs a new PointF object and initializes it with the specified values.

Parameters
xThe value of X coordinate
yThe value of Y coordinate

◆ PointF() [3/3]

System::Drawing::PointF::PointF ( const SizeF size)

Constructs a new PointF object and initializes its X and Y coordinates values with the values of width and height of the specifide SizeF object correspondingly.

Parameters
sizeA SizeF object whose width and height values are used to initialize X and Y coordinates values of the PointF object being created

Member Function Documentation

◆ Add() [1/2]

static PointF System::Drawing::PointF::Add ( const PointF point,
const SizeF size 
)
static

Adds the width and height values of the specified SizeF object to the X and Y coordinates values of the specified PointF object correspondingly.

Parameters
pointThe point to translate
sizeThe SizeF object that specifies the values to add to the coordinates values of the point
Returns
A new PointF object whose X coordinate value is equal to the sum of X coordinate value of point and the width value of size and Y coordinate value is equal to the sum of Y coordinate value of point and the height value of size

◆ Add() [2/2]

static PointF System::Drawing::PointF::Add ( const PointF point,
const Size size 
)
static

Adds the width and height values of the specified Size object to the X and Y coordinates values of the specified PointF object correspondingly.

Parameters
pointThe point to translate
sizeThe Size object that specifies the values to add to the coordinates values of the point
Returns
A new PointF object whose X coordinate value is equal to the sum of X coordinate value of point and the width value of size and Y coordinate value is equal to the sum of Y coordinate value of point and the height value of size

◆ Equals()

bool System::Drawing::PointF::Equals ( const PointF point) const

Determines if the current object and the specified object are equal, i.e. represent the same pair of X and Y coordinates values.

Parameters
pointPointF The object to compare the current object with
Returns
True if the objects are equal, otherwise - false

◆ get_IsEmpty()

bool System::Drawing::PointF::get_IsEmpty ( ) const
inline

Determines if both X and Y coordinates values are equal to 0.

Returns
True if both X and Y coordinates represented by the current object are 0; otherwise - false

◆ get_X()

float System::Drawing::PointF::get_X ( ) const
inline

Returns the value of X coordinate represented by the current object.

◆ get_Y()

float System::Drawing::PointF::get_Y ( ) const
inline

Returns the value of Y coordinate represented by the current object.

◆ GetHashCode()

int System::Drawing::PointF::GetHashCode ( ) const
inline

Returns a hash code for the current object.

◆ IsNull()

bool System::Drawing::PointF::IsNull ( ) const
inline

Always returns false.

◆ operator bool()

System::Drawing::PointF::operator bool ( )
inlineexplicit

Always returns true.

◆ set_X()

void System::Drawing::PointF::set_X ( float  value)
inline

Sets the value of X coordinate represented by the current object.

Parameters
valueThe value to set

◆ set_Y()

void System::Drawing::PointF::set_Y ( float  value)
inline

Sets the value of Y coordinate represented by the current object.

Parameters
valueThe value to set

◆ Subtract() [1/2]

static PointF System::Drawing::PointF::Subtract ( const PointF point,
const SizeF size 
)
static

Subtracts the width and height values of the specified SizeF object from the X and Y coordinates values of the specified PointF object correspondingly.

Parameters
pointThe point to translate
sizeThe SizeF object that specifies the values to subtract from the coordinates values of the point
Returns
A new PointF object whose X coordinate value is equal to the result of subtraction of the width value of size from the X coordinate value of point and Y coordinate value is equal to the result of subtraction of the height value of size from the Y coordinate value of point

◆ Subtract() [2/2]

static PointF System::Drawing::PointF::Subtract ( const PointF point,
const Size size 
)
static

Subtracts the width and height values of the specified Size object from the X and Y coordinates values of the specified PointF object correspondingly.

Parameters
pointThe point to translate
sizeThe Size object that specifies the values to subtract from the coordinates values of the point
Returns
A new PointF object whose X coordinate value is equal to the result of subtraction of the width value of size from the X coordinate value of point and Y coordinate value is equal to the result of subtraction of the height value of size from the Y coordinate value of point

◆ ToString()

System::String System::Drawing::PointF::ToString ( ) const
inline

Returns the string representation of the pair of X and Y coordinates values represented by the current object.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const PointF point1,
const PointF point2 
)
friend

Determines if the specified PointF objects are not equal, i.e. represent the distinct pairs of X and Y coordinates values.

Parameters
point1The first comparand
point2The second comparand
Returns
True if the objects are not equal, otherwise - false

◆ operator+ [1/2]

PointF operator+ ( const PointF point,
const SizeF size 
)
friend

Adds the width and height values of the specified SizeF object to the X and Y coordinates values of the specified PointF object correspondingly.

Parameters
pointThe point to translate
sizeThe SizeF object that specifies the values to add to the coordinates values of the point
Returns
A new PointF object whose X coordinate value is equal to the sum of X coordinate value of point and the width value of size and Y coordinate value is equal to the sum of Y coordinate value of point and the height value of size

◆ operator+ [2/2]

PointF operator+ ( const PointF point,
const Size size 
)
friend

Adds the width and height values of the specified Size object to the X and Y coordinates values of the specified PointF object correspondingly.

Parameters
pointThe point to translate
sizeThe Size object that specifies the values to add to the coordinates values of the point
Returns
A new PointF object whose X coordinate value is equal to the sum of X coordinate value of point and the width value of size and Y coordinate value is equal to the sum of Y coordinate value of point and the height value of size

◆ operator- [1/2]

PointF operator- ( const PointF point,
const SizeF size 
)
friend

Subtracts the width and height values of the specified SizeF object from the X and Y coordinates values of the specified PointF object correspondingly.

Parameters
pointThe point to translate
sizeThe SizeF object that specifies the values to subtract from the coordinates values of the point
Returns
A new PointF object whose X coordinate value is equal to the result of subtraction of the width value of size from the X coordinate value of point and Y coordinate value is equal to the result of subtraction of the height value of size from the Y coordinate value of point

◆ operator- [2/2]

PointF operator- ( const PointF point,
const Size size 
)
friend

Subtracts the width and height values of the specified Size object from the X and Y coordinates values of the specified PointF object correspondingly.

Parameters
pointThe point to translate
sizeThe Size object that specifies the values to subtract from the coordinates values of the point
Returns
A new PointF object whose X coordinate value is equal to the result of subtraction of the width value of size from the X coordinate value of point and Y coordinate value is equal to the result of subtraction of the height value of size from the Y coordinate value of point

◆ operator<

bool operator< ( const PointF point1,
const PointF point2 
)
friend

Always throws InvalidOperationException.

Exceptions
InvalidOperationExceptionAlways

◆ operator==

bool operator== ( const PointF point1,
const PointF point2 
)
friend

Determines if the specified PointF objects are equal, i.e. represent the same pair of X and Y coordinates values.

Parameters
point1The first comparand
point2The second comparand
Returns
True if the objects are equal, otherwise - false

Member Data Documentation

◆ Empty

const PointF System::Drawing::PointF::Empty
static

An empty instance of PointF class whose X and Y coordinates values are 0.