Point 구조체
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
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 | |
| Y |
메서드
| Name | Description |
|---|---|
| Add(Point, Vector) | |
| Equals(Object) | |
| Equals(Point, Point) |
두 Point 구조체를 같음으로 비교합니다. |
| Equals(Point) |
두 Point 구조체를 같음으로 비교합니다. |
| GetHashCode() |
이에 Point대한 해시 코드를 반환합니다. |
| Multiply(Point, Matrix) | |
| Offset(Double, Double) | |
| Parse(String) | |
| Subtract(Point, Point) | |
| Subtract(Point, Vector) | |
| ToString() | |
| ToString(IFormatProvider) |
연산자
| Name | Description |
|---|---|
| Addition(Point, Vector) | |
| Equality(Point, Point) |
두 Point 구조체를 같음으로 비교합니다. |
| Explicit(Point to Size) | |
| Explicit(Point to Vector) | |
| Inequality(Point, Point) |
같지 않음에 대한 두 Point 구조를 비교합니다. |
| Multiply(Point, Matrix) | |
| Subtraction(Point, Point) | |
| Subtraction(Point, Vector) |
명시적 인터페이스 구현
| Name | Description |
|---|---|
| IFormattable.ToString(String, IFormatProvider) |
이 멤버는 WPF(Windows Presentation Foundation) 인프라를 지원하며 코드에서 직접 사용할 수 없습니다. 이 멤버에 대한 설명은 을 참조하세요 ToString(String, IFormatProvider). |