Point::operator+ メソッド (gdiplustypes.h)

Point::operator+ メソッドは、2 つの Point オブジェクトの X および Y データ メンバーを追加します。

構文

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

パラメーター

[in, ref] point

型: const Point

X および Y データ メンバーがこの Point オブジェクトの X および Y データ メンバーに追加される Point オブジェクトへの参照。

戻り値

種類: ポイント

このメソッドは、2 つの Point オブジェクトの合計である Point オブジェクト 返します。

解説

このメソッドは、 Point オブジェクトの加算演算子をオーバーロードします。 A、B、C が Point オブジェクトの場合、ステートメント C = A + BC = A.operator+(B)と同じです。

次の例では、2 つの Point オブジェクトを作成し、2 つの Point オブジェクトを追加し、結果を 3 番目の Point オブジェクトに格納します。

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

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

要件

   
サポートされている最小のクライアント Windows XP、Windows 2000 Professional [デスクトップ アプリのみ]
サポートされている最小のサーバー Windows 2000 Server [デスクトップ アプリのみ]
対象プラットフォーム Windows
ヘッダー gdiplustypes.h (Gdiplus.h を含む)
Library Gdiplus.lib
[DLL] Gdiplus.dll

関連項目

Point

Point::Equals

Point::operator-

Pointf