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에서 값과 X 쉼표 사이의 Y 구분 기호는 Point 쉼표 또는 공백일 수 있습니다.

일부 문화권에서는 마침표 문자 대신 쉼표 문자를 10진수 구분 기호로 사용할 수 있습니다. 고정 문화권에 대한 XAML 처리는 대부분의 XAML 프로세서 구현에서 en-US 기본값이며 해당 기간은 10진수 구분 기호가 될 것으로 예상합니다. XAML에서 쉼표 문자를 지정하는 Point 경우 특성 값이 구성 요소로 변환되는 문자열 형식 Point 과 충돌하므로 쉼표 문자를 10진수 구분 기호로 XY 사용하지 않아야 합니다.

XAML 특성 사용

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

XAML 값

x 이 좌표의 x 좌표입니다 Point.

y 이 y 좌표입니다 Point.

생성자

Name Description
Point(Double, Double)

지정된 좌표를 포함하는 새 Point 구조를 만듭니다.

속성

Name Description
X

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

Y

Y값의 Point-좌표 값을 가져오거나 설정합니다.

메서드

Name Description
Add(Point, Vector)

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

Equals(Object)

지정된 Object 좌표가 Point a인지 여부와 이 Point좌표가 포함되는지 여부를 확인합니다.

Equals(Point, Point)

Point 구조체를 같음으로 비교합니다.

Equals(Point)

Point 구조체를 같음으로 비교합니다.

GetHashCode()

이에 Point대한 해시 코드를 반환합니다.

Multiply(Point, Matrix)

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

Offset(Double, Double)

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

Parse(String)

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

Subtract(Point, Point)

지정된 Point 다른 Point 지정한 값을 빼고 차이를 .로 Vector반환합니다.

Subtract(Point, Vector)

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

ToString()

String표현을 Point 만듭니다.

ToString(IFormatProvider)

String표현을 Point 만듭니다.

연산자

Name Description
Addition(Point, Vector)

지정된 PointVector 값을 변환하고 결과를 반환합니다.

Equality(Point, Point)

Point 구조체를 같음으로 비교합니다.

Explicit(Point to Size)

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

Explicit(Point to Vector)

Vector 점 값과 X 같은 값과 점 값 X 이 같은 값을 가진 YY 구조를 만듭니다.

Inequality(Point, Point)

같지 않음에 대한 두 Point 구조를 비교합니다.

Multiply(Point, Matrix)

지정된 에 지정된 Point 값을 변환합니다 Matrix.

Subtraction(Point, Point)

지정된 Point 다른 Point 지정한 값을 빼고 차이를 .로 Vector반환합니다.

Subtraction(Point, Vector)

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

명시적 인터페이스 구현

Name Description
IFormattable.ToString(String, IFormatProvider)

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

적용 대상