Dibaca dalam bahasa Inggeris Edit

Kongsi melalui


Point.Addition(Point, Vector) Operator

Definition

Translates the specified Point by the specified Vector and returns the result.

C#
public static System.Windows.Point operator +(System.Windows.Point point, System.Windows.Vector vector);

Parameters

point
Point

The point to translate.

vector
Vector

The amount by which to translate point.

Returns

The result of translating the specified point by the specified vector.

Examples

The following example shows how to add a Point to a Vector using the overloaded (+) operator.

C#
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;
}

Applies to

Produk Versi
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also