Point.op_Subtraction メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Point.op_Subtraction メソッドの意味・解説 

Point.op_Subtraction メソッド

Point指定Size の負の値だけ平行移動ます。

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

使用例使用例

PointConverter と op_Subtraction 演算子使用する方法次のコード例示します。この例は、Windows フォームでの使用意図してデザインされています。このコードフォーム貼り付けフォームPaint イベント処理するときに PaintEventArgs の e渡して ShowPointConverter メソッド呼び出します。

Private Sub ShowPointConverter(ByVal
 e As PaintEventArgs)

    ' Create the PointConverter.
    Dim converter As System.ComponentModel.TypeConverter
 = _
        System.ComponentModel.TypeDescriptor.GetConverter(GetType(Point))

    Dim point1 As Point = _
        CType(converter.ConvertFromString("200, 200"),
 Point)

    ' Use the subtraction operator to get a second point.
    Dim point2 As Point = Point.op_Subtraction(point1,
 _
        New Size(190, 190))

    ' Draw a line between the two points.
    e.Graphics.DrawLine(Pens.Black, point1, point2)
End Sub
private void ShowPointConverter(PaintEventArgs
 e)
{

    // Create the PointConverter.
    System.ComponentModel.TypeConverter converter = 
        System.ComponentModel.TypeDescriptor.GetConverter(typeof(Point));

    Point point1 = (Point) converter.ConvertFromString("200, 200");

    // Use the subtraction operator to get a second point.
    Point point2 = point1 - new Size(190, 190);

    // Draw a line between the two points.
    e.Graphics.DrawLine(Pens.Black, point1, point2);
}
void ShowPointConverter( PaintEventArgs^ e )
{
   // Create the PointConverter.
   System::ComponentModel::TypeConverter^ converter = System::ComponentModel::TypeDescriptor::GetConverter(
 Point::typeid );
   Point point1 =  *dynamic_cast<Point^>(converter->ConvertFromString( "200,
 200" ));

   // Use the subtraction operator to get a second point.
   Point point2 = point1 - System::Drawing::Size( 190, 190 );

   // Draw a line between the two points.
   e->Graphics->DrawLine( Pens::Black, point1, point2 );
}
private void ShowPointConverter(PaintEventArgs
 e)
{
    // Create the PointConverter.
    PointConverter converter = new PointConverter();
    Point point1 = (Point)converter.ConvertFromString("200, 200");

    // Use the subtraction operator to get a second point.
    Point point2 = Point.op_Subtraction(point1 , new Size(190,
 190));

    // Draw a line between the two points.
    e.get_Graphics().DrawLine(Pens.get_Black(), point1, point2);
} //ShowPointConverter
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Point.op_Subtraction メソッド」の関連用語

Point.op_Subtraction メソッドのお隣キーワード
検索ランキング

   

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



Point.op_Subtraction メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS