Point 구조체

정의

2차원 공간에서 x 및 y 좌표 쌍을 나타냅니다.

public value class Point : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.PointConverter))]
[System.Serializable]
public struct Point : IFormattable
[System.ComponentModel.TypeConverter(typeof(System.Windows.PointConverter))]
public struct Point : IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.PointConverter))>]
[<System.Serializable>]
type Point = struct
    interface IFormattable
[<System.ComponentModel.TypeConverter(typeof(System.Windows.PointConverter))>]
type Point = struct
    interface IFormattable
Public Structure Point
Implements IFormattable
상속
특성
구현

예제

다음 예제에서는 두 가지 경우를 확인 하는 방법을 보여 줍니다 Point 구조체가 동일 합니다. 값을 할당 하는 방법을 보여 줍니다는 Point 구조를 선언할 때 및 구조를 선언한 후 구성 합니다.

// Checks if two Points are equal using the overloaded inequality operator.
private Boolean pointInequalityExample()
{
    // Checks if two Points are not equal using the overloaded inequality operator.

    // Declaring point1 and initializing x,y values
    Point point1 = new Point(10, 5);

    // Declaring point2 without initializing x,y values
    Point point2 = new Point();

    // Boolean to hold the result of the comparison
    Boolean areNotEqual;

    // assigning values to point2
    point2.X = 15;
    point2.Y = 40;

    // Compare Point structures for equality.
    // areNotEqual is True
    areNotEqual = (point1 != point2);

    return areNotEqual;
}
' Checks if two Points are equal using the overloaded inequality operator.
Private Function pointInequalityExample() As Boolean
    ' Checks if two Points are not equal using the overloaded inequality operator.

    ' Declaring point1 and initializing x,y values
    Dim point1 As New Point(10, 5)

    ' Declaring point2 without initializing x,y values
    Dim point2 As New Point()

    ' Boolean to hold the result of the comparison
    Dim areNotEqual As Boolean

    ' assigning values to point2
    point2.X = 15
    point2.Y = 40

    ' Compare Point structures for equality.
    ' areNotEqual is True
    areNotEqual = (point1 <> point2)

    Return areNotEqual

End Function

설명

XAML을 사이의 구분 기호에는 XY 의 값을 Point 쉼표 또는 공백을 일 수 있습니다.

일부 문화권 마침표 대신 소수 구분 기호로 쉼표 문자를 사용할 수 있습니다. 고정 문화권에 대 한 처리 하는 XAML 대부분의 XAML 프로세서 구현에서 EN-US로 기본값과 소수 구분 기호로 마침표를 예상 합니다. 지정 하는 경우 소수 구분 기호로 쉼표를 사용 하면 안을 Point , XAML에서의 문자열 형식 변환을 사용 하 여 충돌 하는 때문에 Point 특성 값에는 XY 구성 요소입니다.

XAML 특성 사용

<object property="x,y"/>  
-or-  
<object property="x y"/>  

XAML 값

x
Point의 x좌표입니다.

y
Point의 y좌표입니다.

생성자

Point(Double, Double)

지정된 좌표가 들어 있는 새 Point 구조체를 만듭니다.

속성

X

X 구조체의 Point 좌표 값을 가져오거나 설정합니다.

Y

YPoint 좌표 값을 가져오거나 설정합니다.

메서드

Add(Point, Vector)

VectorPoint를 추가하고 그 결과를 Point 구조체로 반환합니다.

Equals(Object)

지정된 ObjectPoint인지 여부와 이 Point와 동일한 좌표가 들어 있는지 여부를 확인합니다.

Equals(Point)

Point 구조체가 같은지 여부를 비교합니다.

Equals(Point, Point)

Point 구조체가 같은지 여부를 비교합니다.

GetHashCode()

Point의 해시 코드를 반환합니다.

Multiply(Point, Matrix)

지정된 Point 구조체로 지정된 Matrix 구조체를 변환합니다.

Offset(Double, Double)

점의 XY 좌표를 지정된 크기만큼 오프셋합니다.

Parse(String)

지정된 Point에서 String를 생성합니다.

Subtract(Point, Point)

또 다른 지정된 Point에서 지정된 Point를 빼고 그 차이를 Vector로 반환합니다.

Subtract(Point, Vector)

지정된 Vector에서 지정된 Point를 빼고 결과 Point를 반환합니다.

ToString()

StringPoint 표현을 만듭니다.

ToString(IFormatProvider)

StringPoint 표현을 만듭니다.

연산자

Addition(Point, Vector)

지정된 Point에 따라 지정된 Vector를 변환한 다음 결과를 반환합니다.

Equality(Point, Point)

Point 구조체가 같은지 여부를 비교합니다.

Explicit(Point to Size)

Size가 이 점의 Width 값과 같고 X가 이 점의 Height 값과 같은 Y 구조체를 만듭니다.

Explicit(Point to Vector)

Vector 값이 점의 X 값과 같고 X 값이 점의 Y 값과 같은 Y 구조체를 만듭니다.

Inequality(Point, Point)

Point 구조체가 다른지 여부를 비교합니다.

Multiply(Point, Matrix)

지정된 Point에 따라 지정된 Matrix를 변환합니다.

Subtraction(Point, Point)

또 다른 지정된 Point에서 지정된 Point를 빼고 그 차이를 Vector로 반환합니다.

Subtraction(Point, Vector)

지정된 Vector에서 지정된 Point를 빼고 결과 Point를 반환합니다.

명시적 인터페이스 구현

IFormattable.ToString(String, IFormatProvider)

이 멤버는 WPF(Windows Presentation Foundation) 인프라를 지원하며 코드에서 직접 사용할 수 없습니다. 이 멤버에 대한 설명은 ToString(String, IFormatProvider)를 참조하세요.

적용 대상