Partager via


PointF.operator-(const PointF) method

Applies to: desktop apps only

The PointF::operator- method subtracts the X and Y data members of two PointF objects.

Syntax

PointF operator-(
  [in, ref]  const PointF &point
);

Parameters

  • point [in, ref]
    Type: const PointF

    Reference to a PointF object whose X and Y data members are subtracted from the X and Y data members of this PointF object.

Return value

Type:

Type: PointF****

This method returns a PointF object that is the difference of two PointF objects.

Remarks

This method overloads the subtraction operator for PointF objects. If A, B, and C are PointF objects, the statement C = A - B is equivalent to C = A.operator-(B).

Examples

The following example creates two PointF objects, then subtracts the second PointF object from the first PointF object and stores the result in a third PointF object.

PointF point1(40.0f, 10.0f);
PointF point2(-20.0f, -30.0f);

// Point3 now contains the coordinates (60.0f, 40.0f).
PointF point3 = point1 - point2; 

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplustypes.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

PointF

Equals

operator+

Point

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012