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

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

RectangleF.op_Equality メソッド

2 つRectangleF 構造体位置およびサイズが同じかどうかテストします

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

Public Shared Operator = ( _
    left As RectangleF, _
    right As RectangleF _
) As Boolean
public static bool operator
 == (
    RectangleF left,
    RectangleF right
)
public:
static bool operator == (
    RectangleF left, 
    RectangleF right
)
J# では、オーバーロードされた演算子使用できません。
JScriptでは、 オーバーロードされた演算子使用できますが、新規に宣言することはできません。

パラメータ

left

等値演算子左側表示される RectangleF 構造体

right

等値演算子右側表示される RectangleF 構造体

戻り値
指定2 つRectangleF 構造体の X、Y、WidthHeight の各プロパティ等し場合、この演算子true返します

使用例使用例

op_Implicit メンバ、RectangleF メンバ、および op_Equality メンバ使用方法を示すコード例次に示します。この例は、Windows フォームでの使用意図してデザインされています。このコードフォーム貼り付けフォームPaint イベント処理するときに PaintEventArgs の e渡して ConvertRectangleToRectangleF メソッド呼び出します。

Private Sub ConvertRectangleToRectangleF( _
    ByVal e As PaintEventArgs)

    ' Create a rectangle.
    Dim rectangle1 As New
 Rectangle(30, 40, 50, 100)

    ' Convert it to a RectangleF.
    Dim convertedRectangle As RectangleF =
 _
        RectangleF.op_Implicit(rectangle1)

    ' Create a new RectangleF.
    Dim rectangle2 As New
 RectangleF(New PointF(30.0F, 40.0F), _
        New SizeF(50.0F, 100.0F))

    ' Create a custom, partially transparent brush.
    Dim redBrush As New
 SolidBrush(Color.FromArgb(40, Color.Red))

    ' Compare the converted rectangle with the new one.  If they 
    ' are equal, draw and fill the rectangles on the form.
    If (RectangleF.op_Equality(convertedRectangle, rectangle2))
 Then
        e.Graphics.FillRectangle(redBrush, rectangle2)
    End If

    ' Dispose of the custom brush.
    redBrush.Dispose()
End Sub
private void ConvertRectangleToRectangleF(PaintEventArgs
 e)
{

    // Create a rectangle.
    Rectangle rectangle1 = new Rectangle(30, 40, 50, 100);

    // Convert it to a RectangleF.
    RectangleF convertedRectangle = rectangle1;

    // Create a new RectangleF.
    RectangleF rectangle2 = new RectangleF(new
 PointF(30.0F, 40.0F),
        new SizeF(50.0F, 100.0F));

    // Create a custom, partially transparent brush.
    SolidBrush redBrush = new SolidBrush(Color.FromArgb(40, Color.Red));

    // Compare the converted rectangle with the new one.  If they 
    // are equal draw and fill the rectangles on the form.
    if (convertedRectangle == rectangle2)
    {
        e.Graphics.FillRectangle(redBrush, rectangle2);
    }

    // Dispose of the custom brush.
    redBrush.Dispose();
}

private:
   void ConvertRectangleToRectangleF( PaintEventArgs^ e )
   {
      // Create a rectangle.
      Rectangle rectangle1 = Rectangle(30,40,50,100);

      // Convert it to a RectangleF.
      RectangleF convertedRectangle = rectangle1;

      // Create a new RectangleF.
      RectangleF rectangle2 = RectangleF(PointF(30.0F,40.0F),SizeF(50.0F,100.0F));

      // Create a custom, partially transparent brush.
      SolidBrush^ redBrush = gcnew SolidBrush( Color::FromArgb( 40, Color::Red )
 );

      // Compare the converted rectangle with the new one.  If they
 
      // are equal draw and fill the rectangles on the form.
      if ( convertedRectangle == rectangle2 )
      {
         e->Graphics->FillRectangle( redBrush, rectangle2 );
      }

      // Dispose of the custom brush.
      delete redBrush;
   }
};
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「RectangleF.op_Equality メソッド」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS