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

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

語法

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

參數

[in, ref] point

類型: const PointF

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

傳回值

類型: PointF

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

備註

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

範例

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

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; 

規格需求

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

另請參閱

等於

PointF

operator+