Point.operator-(const Point) method

Applies to: desktop apps only

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

Syntax

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

Parameters

  • point [in, ref]
    Type: const Point

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

Return value

Type:

Type: Point****

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

Remarks

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

Examples

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

Point point1(40, 10);
Point point2(-20, -30);

// Point3 now contains the coordinates (60, 40).
Point 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

Point

Point::Equals

Point::operator+

PointF

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012