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
- 継承
- 属性
- 実装
例
次の例は、2 つの 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 を指定する場合は、コンマ文字を 10 進区切り記号として使用しないでください。これは、 Point 属性値を X および Y コンポーネントに変換する文字列型と競合するためです。
XAML 属性の使用法
<object property="x,y"/>
-or-
<object property="x y"/>
XAML 値
x この Pointの x 座標。
y この Pointの y 座標。
コンストラクター
| 名前 | 説明 |
|---|---|
| Point(Double, Double) |
指定した座標を含む新しい Point 構造体を作成します。 |
プロパティ
| 名前 | 説明 |
|---|---|
| X | |
| Y |
メソッド
| 名前 | 説明 |
|---|---|
| Add(Point, Vector) | |
| Equals(Object) |
指定した Object が Point かどうか、および指定した Pointと同じ座標が含まれているかどうかを判断します。 |
| Equals(Point, Point) |
2 つの Point 構造体の等価性を比較します。 |
| Equals(Point) |
2 つの Point 構造体の等価性を比較します。 |
| GetHashCode() |
この Pointのハッシュ コードを返します。 |
| Multiply(Point, Matrix) | |
| Offset(Double, Double) | |
| Parse(String) | |
| Subtract(Point, Point) | |
| Subtract(Point, Vector) | |
| ToString() | |
| ToString(IFormatProvider) |
演算子
| 名前 | 説明 |
|---|---|
| Addition(Point, Vector) | |
| Equality(Point, Point) |
2 つの Point 構造体の等価性を比較します。 |
| Explicit(Point to Size) | |
| Explicit(Point to Vector) | |
| Inequality(Point, Point) |
2 つの Point 構造体の不等値を比較します。 |
| Multiply(Point, Matrix) | |
| Subtraction(Point, Point) | |
| Subtraction(Point, Vector) |
明示的なインターフェイスの実装
| 名前 | 説明 |
|---|---|
| IFormattable.ToString(String, IFormatProvider) |
このメンバーは、Windows Presentation Foundation (WPF) インフラストラクチャをサポートしており、コードから直接使用するためのものではありません。 このメンバーの説明については、 ToString(String, IFormatProvider)を参照してください。 |