Point コンストラクタ (Size)
アセンブリ: 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
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Point コンストラクタ (Int32)
アセンブリ: 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
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Point コンストラクタ (Int32, Int32)
アセンブリ: 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
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
Point コンストラクタ
オーバーロードの一覧
名前 | 説明 |
---|---|
Point (Int32) | 整数値で指定された座標を使用して、Point クラスの新しいインスタンスを初期化します。 |
Point (Size) | Size から Point クラスの新しいインスタンスを初期化します。 |
Point (Int32, Int32) | 座標を指定して、Point クラスの新しいインスタンスを初期化します。 .NET Compact Framework によってサポートされています。 |
Point フィールド
Point プロパティ
Point メソッド
パブリック メソッド
名前 | 説明 | |
---|---|---|
Add | 指定した Size を指定した Point に追加します。 | |
Ceiling | PointF の値を次の整数値に丸めることによって、指定した PointF を Point に変換します。 | |
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 の値を最も近い整数に丸めることによって、指定した PointF を Point オブジェクトに変換します。 | |
Subtract | 指定した Point から指定した Size を減算した結果を返します。 | |
ToString | オーバーライドされます。 この Point をユーザーが判読できる文字列に変換します。 | |
Truncate | Point の値を切り捨てることによって、指定した PointF を Point に変換します。 |
名前 | 説明 | |
---|---|---|
Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) | |
MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
Point メンバ
2 次元平面に点を定義する、整数座標ペア (x 座標と y 座標) を表します。
Point データ型で公開されるメンバを以下の表に示します。
パブリック コンストラクタ
パブリック フィールド
パブリック プロパティ
パブリック メソッド
名前 | 説明 | |
---|---|---|
Add | 指定した Size を指定した Point に追加します。 | |
Ceiling | PointF の値を次の整数値に丸めることによって、指定した PointF を Point に変換します。 | |
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 の値を最も近い整数に丸めることによって、指定した PointF を Point オブジェクトに変換します。 | |
Subtract | 指定した Point から指定した Size を減算した結果を返します。 | |
ToString | オーバーライドされます。 この Point をユーザーが判読できる文字列に変換します。 | |
Truncate | Point の値を切り捨てることによって、指定した PointF を Point に変換します。 |
名前 | 説明 | |
---|---|---|
Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) | |
MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
Point 構造体
アセンブリ: System.Drawing (system.drawing.dll 内)
構文
これらの型に対して定義された、オーバーロードされた演算子をいくつか使用して、ポイントとサイズを作成するコード例を次に示します。この例では、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
プラットフォーム
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
参照
固有名詞の分類
Weblioに収録されているすべての辞書からpointを検索する場合は、下記のリンクをクリックしてください。
全ての辞書からpointを検索
「point」に関係したコラム
-
株価分析のバイセルポイント(buy sell point)とは、テクニカル指標のMACDにおける売買のエントリーポイントを見やすく描画したテクニカル指標のことです。MACDは、長期と短期のEMA(指数...
FXのチャート分析ソフトMT4でポイントアンドフィギュアを表示するには
ポイントアンドフィギュア(Point and Figure、P&F)は、為替レートの値動きに対して×と○のマークを付けて表示するテクニカル指標です。ポイントアンドフィギュアでは、時系列の計算をしないと...
-
FX(外国為替証拠金取引)のポイントアンドフィギュア(Point and Figure、P&F)とは、為替レートの値動きに対して×と○のマークを付けて表示するテクニカル指標です。ポイントアンドフィギュ...
-
海外のFX業者とは、日本に現地法人を設立していないFX業者のことです。海外のFX業者と日本国内のFX業者との大きな違いは、日本国内の法律が適用されるかどうかです。日本国内のFX業者の場合は「金融商品取...
FXのチャート分析ソフトMT4で1つのチャート画面に2つの通貨ペアを表示するには
FX(外国為替証拠金取引)のチャート分析ソフトMT4(Meta Trader 4)では、1つのチャート画面に1つの通貨ペアのチャートが表示できます。2つの通貨ペアのチャートを見比べたい時には、2つのチ...
FXのチャート分析ソフトMT4で10分足や2時間足などを表示するには
FX(外国為替証拠金取引)のチャート分析ソフトMT4(Meta Trader 4)では、次の時間足の表示ができます。ティック1分足5分足15分足30分足1時間足4時間足日足週足MT4では、10分足や1...
- pointのページへのリンク