pointとは? わかりやすく解説

Point コンストラクタ (Size)

Size から Point クラス新しインスタンス初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

使用例使用例

op_Equality 演算子使用する方法と、Size または 2 つ整数から Point生成する方法次のコード例示しますまた、X プロパティと Y プロパティ使用方法示します。この例は、Windows フォームでの使用意図してデザインされています。Button1 という名前のボタン配置されているフォームコード貼り付けButton1_Click メソッドボタンClick イベント関連付けます。

Private Sub Button1_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button1.Click

    ' Construct a new Point with integers.
    Dim Point1 As New Point(100,
 100)

    ' Create a Graphics object.
    Dim formGraphics As Graphics = Me.CreateGraphics()

    ' Construct another Point, this time using a Size.
    Dim Point2 As New Point(New
 Size(100, 100))

    ' Call the equality operator to see if the points are equal,  
    ' and if so print out their x and y values.
    If (Point.op_Equality(Point1, Point2)) Then
        formGraphics.DrawString(String.Format("Point1.X:
 " & _
            "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}",
 _
            New Object() {Point1.X, Point2.X,
 Point1.Y, Point2.Y}), _
            Me.Font, Brushes.Black, New PointF(10,
 70))
    End If

End Sub
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{

    // Construct a new Point with integers.
    Point Point1 = new Point(100, 100);

    // Create a Graphics object.
    Graphics formGraphics = this.CreateGraphics();

    // Construct another Point, this time using a Size.
    Point Point2 = new Point(new Size(100,
 100));

    // Call the equality operator to see if the points are equal,  
    // and if so print out their x and y values.
    if (Point1 == Point2)
    {
        formGraphics.DrawString(String.Format("Point1.X: " +
            "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}",
            new object[]{Point1.X, Point2.X, Point1.Y, Point2.Y})
,
            this.Font, Brushes.Black, new PointF(10,
 70));
    }

}
private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      // Construct a new Point with integers.
      Point Point1 = Point(100,100);

      // Create a Graphics object.
      Graphics^ formGraphics = this->CreateGraphics();

      // Construct another Point, this time using a Size.
      Point Point2 = Point(System::Drawing::Size( 100, 100 ));

      // Call the equality operator to see if the points are equal,
  
      // and if so print out their x and y values.
      if ( Point1 == Point2 )
      {
         array<Object^>^temp0 = {Point1.X,Point2.X,Point1.Y,Point2.Y};
         formGraphics->DrawString( String::Format( "Point1.X: "
         "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}", temp0 ), this->Font,
 Brushes::Black, PointF(10,70) );
      }
   }
private void button1_Click(Object sender, System.EventArgs
 e)
{
    // Construct a new Point with integers.
    Point point1 = new Point(100, 100);

    // Create a Graphics object.
    Graphics formGraphics = this.CreateGraphics();

    // Construct another Point, this time using a Size.
    Point point2 = new Point(new Size(100,
 100));

    // Call the equality operator to see if the points are equal,  
    // and if so print out their x and y values.
    if (point1.Equals(point2)) {
        formGraphics.DrawString(String.Format("Point1.X: " 
            + "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}", 
            new Object[] { new Integer(point1.get_X()),
 
            new Integer(point2.get_X()), new
 Integer(point1.get_Y()), 
            new Integer(point2.get_Y())    }), this.get_Font()
,
            Brushes.get_Black(), new PointF(10, 70));
    }
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Point コンストラクタ (Int32)

整数値で指定され座標使用してPoint クラス新しインスタンス初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

解説解説
使用例使用例

Point コンストラクタと System.Drawing.Size コンストラクタ、および System.Drawing.ContentAlignment 列挙体の使用方法を示すコード例次に示します。この例を実行するには、Label1 という名前のラベル配置されフォームコンストラクタIntializeLabel1 メソッド呼び出す Windows フォームコード貼り付けます。

Private Sub InitializeLabel1()

    ' Set a border.
    Label1.BorderStyle = BorderStyle.FixedSingle

    ' Set the size, constructing a size from two integers.
    Label1.Size = New Size(100, 50)

    ' Set the location, constructing a point from a 32-bit integer
    ' (using hexadecimal).
    Label1.Location = New Point(&H280028)

    ' Set and align the text on the lower-right side of the label.
    Label1.TextAlign = ContentAlignment.BottomRight
    Label1.Text = "Bottom Right Alignment"
End Sub
private void InitializeLabel1()
{
    // Set a border.
    Label1.BorderStyle = BorderStyle.FixedSingle;

    // Set the size, constructing a size from two integers.
    Label1.Size = new Size(100, 50);

    // Set the location, constructing a point from a 32-bit integer
    // (using hexadecimal).
    Label1.Location = new Point(0x280028);

    // Set and align the text on the lower-right side of the label.
    Label1.TextAlign = ContentAlignment.BottomRight;
    Label1.Text = "Bottom Right Alignment";
}
void InitializeLabel1()
{
   // Set a border.
   Label1->BorderStyle = BorderStyle::FixedSingle;
   
   // Set the size, constructing a size from two integers.
   Label1->Size = System::Drawing::Size( 100, 50 );
   
   // Set the location, constructing a point from a 32-bit integer
   // (using hexadecimal).
   Label1->Location = Point(0x280028);
   
   // Set and align the text on the lower-right side of the label.
   Label1->TextAlign = ContentAlignment::BottomRight;
   Label1->Text = "Bottom Right Alignment";
}
private void Initializelabel1()
{
    // Set a border.
    label1.set_BorderStyle(BorderStyle.FixedSingle);

    // Set the size, constructing a size from two integers.
    label1.set_Size(new Size(100, 50));

    // Set the location, constructing a point from a 32-bit integer
    // (using hexadecimal).
    label1.set_Location(new Point(0x280028));

    // Set and align the text on the lower-right side of the label.
    label1.set_TextAlign(ContentAlignment.BottomRight);
    label1.set_Text("Bottom Right Alignment");
} //Initializelabel1
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Point コンストラクタ (Int32, Int32)

座標指定して、Point クラス新しインスタンス初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

public Point (
    int x,
    int y
)
public:
Point (
    int x, 
    int y
)
public Point (
    int x, 
    int y
)
public function Point (
    x : int, 
    y : int
)

パラメータ

x

点の位置

y

点の垂直位置

使用例使用例

op_Equality 演算子使用する方法と、Size または 2 つ整数から Point生成する方法次のコード例示しますまた、X プロパティと Y プロパティ使用方法示します。この例は、Windows フォームでの使用意図してデザインされています。Button1 という名前のボタン配置されているフォームコード貼り付けButton1_Click メソッドボタンClick イベント関連付けます。

Private Sub Button1_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button1.Click

    ' Construct a new Point with integers.
    Dim Point1 As New Point(100,
 100)

    ' Create a Graphics object.
    Dim formGraphics As Graphics = Me.CreateGraphics()

    ' Construct another Point, this time using a Size.
    Dim Point2 As New Point(New
 Size(100, 100))

    ' Call the equality operator to see if the points are equal,  
    ' and if so print out their x and y values.
    If (Point.op_Equality(Point1, Point2)) Then
        formGraphics.DrawString(String.Format("Point1.X:
 " & _
            "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}",
 _
            New Object() {Point1.X, Point2.X,
 Point1.Y, Point2.Y}), _
            Me.Font, Brushes.Black, New PointF(10,
 70))
    End If

End Sub
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{

    // Construct a new Point with integers.
    Point Point1 = new Point(100, 100);

    // Create a Graphics object.
    Graphics formGraphics = this.CreateGraphics();

    // Construct another Point, this time using a Size.
    Point Point2 = new Point(new Size(100,
 100));

    // Call the equality operator to see if the points are equal,  
    // and if so print out their x and y values.
    if (Point1 == Point2)
    {
        formGraphics.DrawString(String.Format("Point1.X: " +
            "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}",
            new object[]{Point1.X, Point2.X, Point1.Y, Point2.Y})
,
            this.Font, Brushes.Black, new PointF(10,
 70));
    }

}
private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      // Construct a new Point with integers.
      Point Point1 = Point(100,100);

      // Create a Graphics object.
      Graphics^ formGraphics = this->CreateGraphics();

      // Construct another Point, this time using a Size.
      Point Point2 = Point(System::Drawing::Size( 100, 100 ));

      // Call the equality operator to see if the points are equal,
  
      // and if so print out their x and y values.
      if ( Point1 == Point2 )
      {
         array<Object^>^temp0 = {Point1.X,Point2.X,Point1.Y,Point2.Y};
         formGraphics->DrawString( String::Format( "Point1.X: "
         "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}", temp0 ), this->Font,
 Brushes::Black, PointF(10,70) );
      }
   }
private void button1_Click(Object sender, System.EventArgs
 e)
{
    // Construct a new Point with integers.
    Point point1 = new Point(100, 100);

    // Create a Graphics object.
    Graphics formGraphics = this.CreateGraphics();

    // Construct another Point, this time using a Size.
    Point point2 = new Point(new Size(100,
 100));

    // Call the equality operator to see if the points are equal,  
    // and if so print out their x and y values.
    if (point1.Equals(point2)) {
        formGraphics.DrawString(String.Format("Point1.X: " 
            + "{0},Point2.X: {1}, Point1.Y: {2}, Point2.Y {3}", 
            new Object[] { new Integer(point1.get_X()),
 
            new Integer(point2.get_X()), new
 Integer(point1.get_Y()), 
            new Integer(point2.get_Y())    }), this.get_Font()
,
            Brushes.get_Black(), new PointF(10, 70));
    }
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Point コンストラクタ


Point フィールド


パブリック フィールドパブリック フィールド

  名前 説明
パブリック フィールド Empty null 参照 (Visual Basic では Nothing) である Point を表します
参照参照

Point プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Y この Pointy 座標取得または設定します
参照参照

Point メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Add 指定した Size指定した Point に追加します
パブリック メソッド Ceiling PointF の値を次の整数値に丸めることによって、指定した PointFPoint変換します
パブリック メソッド Equals オーバーロードされますオーバーライドされます2 つPoint オブジェクトに同じ座標含めかどうか指定します
パブリック メソッド GetHashCode オーバーライドされます。 この Pointハッシュ コード返します
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド Offset オーバーロードされますPoint指定の量だけ平行移動ます。
パブリック メソッド op_Addition Point指定Size平行移動ます。
パブリック メソッド op_Equality 2 つPoint オブジェクト比較します。その結果によって、2 つPoint オブジェクトの X プロパティと Y プロパティの値が等しかどうか示されます。
パブリック メソッド op_Explicit 指定した Point 構造体Size 構造体変換します
パブリック メソッド op_Implicit 指定した Point 構造体PointF 構造体変換します
パブリック メソッド op_Inequality 2 つPoint オブジェクト比較します。その結果によって、2 つPoint オブジェクトX プロパティY プロパティの値が異なかどうか示されます。
パブリック メソッド op_Subtraction Point指定Size の負の値だけ平行移動ます。
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド Round Point の値を最も近い整数丸めることによって、指定した PointFPoint オブジェクト変換します
パブリック メソッド Subtract 指定した Point から指定した Size減算した結果返します
パブリック メソッド ToString オーバーライドされます。 この Pointユーザー判読できる文字列変換します
パブリック メソッド Truncate Point の値を切り捨てることによって、指定した PointFPoint変換します
プロテクト メソッドプロテクト メソッド
参照参照

Point メンバ

2 次元平面に点を定義する整数座標ペア (x 座標y 座標) を表します

Point データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
パブリック フィールドパブリック フィールド
  名前 説明
パブリック フィールド Empty null 参照 (Visual Basic では Nothing) である Point表します
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Y この Pointy 座標取得または設定します
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Add 指定した Size指定した Point追加します
パブリック メソッド Ceiling PointF の値を次の整数値に丸めることによって、指定した PointFPoint変換します
パブリック メソッド Equals オーバーロードされますオーバーライドされます2 つPoint オブジェクトに同じ座標含めかどうか指定します
パブリック メソッド GetHashCode オーバーライドされます。 この Pointハッシュ コード返します
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド Offset オーバーロードされますPoint指定の量だけ平行移動ます。
パブリック メソッド op_Addition Point指定Size平行移動ます。
パブリック メソッド op_Equality 2 つPoint オブジェクト比較します。その結果によって、2 つPoint オブジェクトの X プロパティと Y プロパティの値が等しかどうか示されます。
パブリック メソッド op_Explicit 指定した Point 構造体Size 構造体変換します
パブリック メソッド op_Implicit 指定した Point 構造体PointF 構造体変換します
パブリック メソッド op_Inequality 2 つPoint オブジェクト比較します。その結果によって、2 つPoint オブジェクトX プロパティY プロパティの値が異なかどうか示されます。
パブリック メソッド op_Subtraction Point指定Size の負の値だけ平行移動ます。
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド Round Point の値を最も近い整数丸めることによって、指定した PointFPoint オブジェクト変換します
パブリック メソッド Subtract 指定した Point から指定した Size減算した結果返します
パブリック メソッド ToString オーバーライドされます。 この Pointユーザー判読できる文字列変換します
パブリック メソッド Truncate Point の値を切り捨てることによって、指定した PointFPoint変換します
プロテクト メソッドプロテクト メソッド
参照参照

Point 構造体

2 次元平面に点を定義する整数座標ペア (x 座標y 座標) を表します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Structure Point
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public struct Point
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public value class Point
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class Point extends ValueType
JScript では、構造体使用できますが、新規に宣言することはできません。
使用例使用例

これらの型に対して定義された、オーバーロードされた演算子いくつか使用してポイントサイズ作成するコード例次に示します。この例では、SystemPens クラス使用方法示します

この例は、Windows フォームでの使用意図してデザインされています。subtractButton という名前の Button格納するフォーム作成しますコードフォーム貼り付けフォームPaint イベント処理メソッドから PaintEventArgs の e渡して CreatePointsAndSizes メソッド呼び出します。

Private Sub CreatePointsAndSizes(ByVal
 e As PaintEventArgs)

    ' Create the starting point.
    Dim startPoint As New
 Point(subtractButton.Size)

    ' Use the addition operator to get the end point.
    Dim endPoint As Point = Point.op_Addition(startPoint,
 _
        New Size(140, 150))

    ' Draw a line between the points.
    e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint)

    ' Convert the starting point to a size and compare it to the
    ' subtractButton size.  
    Dim buttonSize As Size = Point.op_Explicit(startPoint)
    If (Size.op_Equality(buttonSize, subtractButton.Size)) Then

        ' If the sizes are equal, tell the user.
        e.Graphics.DrawString("The sizes are equal.",
 _
            New Font(Me.Font, FontStyle.Italic),
 _
            Brushes.Indigo, 10.0F, 65.0F)
    End If

End Sub
private void CreatePointsAndSizes(PaintEventArgs
 e)
{

    // Create the starting point.
    Point startPoint = new Point(subtractButton.Size);

    // Use the addition operator to get the end point.
    Point endPoint = startPoint + new Size(140, 150);

    // Draw a line between the points.
    e.Graphics.DrawLine(SystemPens.Highlight, startPoint, endPoint);

    // Convert the starting point to a size and compare it to the
    // subtractButton size.  
    Size buttonSize = (Size)startPoint;
    if (buttonSize == subtractButton.Size)

        // If the sizes are equal, tell the user.
    {
        e.Graphics.DrawString("The sizes are equal.", 
            new Font(this.Font, FontStyle.Italic),
 
            Brushes.Indigo, 10.0F, 65.0F);
    }

}
void CreatePointsAndSizes( PaintEventArgs^ e )
{
   // Create the starting point.
   Point startPoint = Point(subtractButton->Size);
   
   // Use the addition operator to get the end point.
   Point endPoint = startPoint + System::Drawing::Size( 140, 150 );
   
   // Draw a line between the points.
   e->Graphics->DrawLine( SystemPens::Highlight, startPoint, endPoint );
   
   // Convert the starting point to a size and compare it to the
   // subtractButton size.  
   System::Drawing::Size buttonSize = (System::Drawing::Size)startPoint;
   if ( buttonSize == subtractButton->Size )
   {
      e->Graphics->DrawString( "The sizes are equal.", gcnew System::Drawing::Font(
 this->Font,FontStyle::Italic ), Brushes::Indigo, 10.0F, 65.0F
 );
   }
}
private void CreatePointsAndSizes(PaintEventArgs
 e)
{
    // Create the starting point.
    Point startPoint = new Point(subtractButton.get_Size());

    // Use the addition operator to get the end point.
    Point endPoint = Point.op_Addition(startPoint, new Size(140,
 150));

    // Draw a line between the points.
    e.get_Graphics().DrawLine(SystemPens.get_Highlight(), startPoint, 
        endPoint);

    // Convert the starting point to a size and compare it to the
    // subtractButton size.  
    Size buttonSize = new Size(startPoint);

    if (buttonSize.Equals(subtractButton.get_Size())) {
        // If the sizes are equal, tell the user.
        e.get_Graphics().DrawString("The sizes are equal.", 
            new Font(this.get_Font(), FontStyle.Italic),
 
            Brushes.get_Indigo(), 10, 65);
    }
} //CreatePointsAndSizes


スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照




固有名詞の分類

このページでは「.NET Framework クラス ライブラリ リファレンス」からpointを検索した結果を表示しています。
Weblioに収録されているすべての辞書からpointを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からpointを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

「point」に関係したコラム

辞書ショートカット

すべての辞書の索引

「point」の関連用語

pointのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



pointのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS