Point.Addition(Point, Vector) 運算子
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
public:
static System::Windows::Point operator +(System::Windows::Point point, System::Windows::Vector vector);
public static System.Windows.Point operator + (System.Windows.Point point, System.Windows.Vector vector);
static member ( + ) : System.Windows.Point * System.Windows.Vector -> System.Windows.Point
Public Shared Operator + (point As Point, vector As Vector) As Point
參數
- point
- Point
要平移的點。
- vector
- Vector
要平移 point
的數量。
傳回
依指定的向量平移指定的點之結果。
範例
下列範例示範如何使用多載的 (+) 運算子,將 加入 PointVector 。
private Point overloadedAdditionOperatorExample()
{
Point point1 = new Point(10, 5);
Vector vector1 = new Vector(20, 30);
// Add point to a Vector using the overloaded (+) operator.
// pointResult is equal to (30,35).
Point pointResult = point1 + vector1;
return pointResult;
}
Private Function overloadedAdditionOperatorExample() As Point
Dim point1 As New Point(10, 5)
Dim vector1 As New Vector(20, 30)
' Add point to a Vector using the overloaded (+) operator.
' pointResult is equal to (30,35).
Dim pointResult As Point = point1 + vector1
Return pointResult
End Function