Point Structure

Represents an x- and y-coordinate pair in two-dimensional space.

Namespace:  System.Windows
Assembly:  WindowsBase (in WindowsBase.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation

[<Sealed>]
[<SerializableAttribute>]
[<TypeConverterAttribute(typeof(PointConverter))>]
type Point =  
    struct 
        interface IFormattable 
    end
<object property="x,y"/>
-or-
<object property="x y"/>

XAML Values

x

The x-coordinate of this Point.

y

The y-coordinate of this Point.

The Point type exposes the following members.

  NameDescription
Public methodPointCreates a new Point structure that contains the specified coordinates.
Top

  NameDescription
Public propertyXGets or sets the X-coordinate value of this Point structure.
Public propertyYGets or sets the Y-coordinate value of this Point.
Top

  NameDescription
Public methodStatic memberAddAdds a Vector to a Point and returns the result as a Point structure.
Public methodEquals(Object)Determines whether the specified Object is a Point and whether it contains the same coordinates as this Point. (Overrides ValueType.Equals(Object).)
Public methodEquals(Point)Compares two Point structures for equality.
Public methodStatic memberEquals(Point, Point)Compares two Point structures for equality.
Public methodGetHashCodeReturns the hash code for this Point. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberMultiplyTransforms the specified Point structure by the specified Matrix structure.
Public methodOffsetOffsets a point's X and Y coordinates by the specified amounts.
Public methodStatic memberParseConstructs a Point from the specified String.
Public methodStatic memberSubtract(Point, Point)Subtracts the specified Point from another specified Point and returns the difference as a Vector.
Public methodStatic memberSubtract(Point, Vector)Subtracts the specified Vector from the specified Point and returns the resulting Point.
Public methodToString()Creates a String representation of this Point. (Overrides ValueType.ToString().)
Public methodToString(IFormatProvider)Creates a String representation of this Point.
Top

  NameDescription
Public operatorStatic memberAdditionTranslates the specified Point by the specified Vector and returns the result.
Public operatorStatic memberEqualityCompares two Point structures for equality.
Public operatorStatic memberExplicit(Point to Vector)Creates a Vector structure with an X value equal to the point's X value and a Y value equal to the point's Y value.
Public operatorStatic memberExplicit(Point to Size)Creates a Size structure with a Width equal to this point's X value and a Height equal to this point's Y value.
Public operatorStatic memberInequalityCompares two Point structures for inequality.
Public operatorStatic memberMultiplyTransforms the specified Point by the specified Matrix.
Public operatorStatic memberSubtraction(Point, Point)Subtracts the specified Point from another specified Point and returns the difference as a Vector.
Public operatorStatic memberSubtraction(Point, Vector)Subtracts the specified Vector from the specified Point and returns the resulting Point.
Top

  NameDescription
Explicit interface implemetationPrivate methodIFormattable.ToStringThis member supports the Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. For a description of this member, see ToString.
Top

In XAML, the delimiter between the X and Y values of a Point can be either a comma or a space.

Some cultures might use the comma character as the decimal delimiter instead of the period character. XAML processing for invariant culture defaults to en-US in most XAML processor implementations, and expects the period to be the decimal delimiter. You should avoid using the comma character as the decimal delimiter if specifying a Point in XAML, because that will clash with the string type conversion of a Point attribute value into the X and Y components.

The following example shows how to check if two Point structures are not equal. It also illustrates how to assign values to a Point structure when the structure is being declared and after the structure has been declared.

No code example is currently available or this language may not be supported.

More Code

How to: Make an Object Follow the Mouse PointerThis example shows how to change the dimensions of an object when the mouse pointer moves on the screen.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft