Share via


Point::operator- 方法 (gdiplustypes.h)

Point::operator- 方法會減去兩個 Point 物件的 XY 數據成員。

語法

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

參數

[in, ref] point

類型: const Point

Point 對象的參考,其 XY 資料成員會從這個 Point 物件的 XY 資料成員減去。

傳回值

類型:

這個方法會傳回 Point 物件,這是兩個 Point 對象的差異。

備註

這個方法會多載 Point 物件的減法運算符。 如果 A、B 和 C 是 Point 物件,則語句 C = A - B 相當於 C = A.operator- (B)

範例

下列範例會建立兩個 Point 物件,然後從第一個 Point 物件減去第二個 Point 物件,並將結果儲存在第三個 Point 物件中。

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

// Point3 now contains the coordinates (60, 40).
Point point3 = point1 - point2; 

規格需求

需求
最低支援的用戶端 Windows XP、Windows 2000 Professional [僅限桌面應用程式]
最低支援的伺服器 Windows 2000 Server [僅限桌面應用程式]
目標平台 Windows
標頭 gdiplustypes.h (包含 Gdiplus.h)
程式庫 Gdiplus.lib
Dll Gdiplus.dll

另請參閱

Point::Equals

Point::operator+

PointF