Rectangle.IsEmpty プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Rectangle.IsEmpty プロパティの意味・解説 

Rectangle.IsEmpty プロパティ

この Rectangleすべての数値プロパティに値ゼロがあるかどうかテストします

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

使用例使用例

Intersect) メンバIsEmpty メンバ、および IntersectsWith メンバコード例次に示します。この例は、Windows フォーム使用する必要があります。このコードフォーム貼り付けフォームPaint イベント処理するときに PaintEventArgs の e渡してこのメソッド呼び出します。

Private Sub InstanceRectangleIntersection(
 _
    ByVal e As PaintEventArgs)

    Dim rectangle1 As New
 Rectangle(50, 50, 200, 100)
    Dim rectangle2 As New
 Rectangle(70, 20, 100, 200)
  
    e.Graphics.DrawRectangle(Pens.Black, rectangle1)
    e.Graphics.DrawRectangle(Pens.Red, rectangle2)

    If (rectangle1.IntersectsWith(rectangle2)) Then
        rectangle1.Intersect(rectangle2)
        If Not (rectangle1.IsEmpty) Then
            e.Graphics.FillRectangle(Brushes.Green, rectangle1)
        End If
    End If
End Sub
private void InstanceRectangleIntersection(PaintEventArgs
 e)
{

    Rectangle rectangle1 = new Rectangle(50, 50, 200, 100);
    Rectangle rectangle2 = new Rectangle(70, 20, 100, 200);

    e.Graphics.DrawRectangle(Pens.Black, rectangle1);
    e.Graphics.DrawRectangle(Pens.Red, rectangle2);

    if (rectangle1.IntersectsWith(rectangle2))
    {
        rectangle1.Intersect(rectangle2);
        if (!rectangle1.IsEmpty)
        {
            e.Graphics.FillRectangle(Brushes.Green, rectangle1);
        }
    }
}
private:
   void InstanceRectangleIntersection( PaintEventArgs^ e )
   {
      Rectangle rectangle1 = Rectangle(50,50,200,100);
      Rectangle rectangle2 = Rectangle(70,20,100,200);
      e->Graphics->DrawRectangle( Pens::Black, rectangle1 );
      e->Graphics->DrawRectangle( Pens::Red, rectangle2 );
      if ( rectangle1.IntersectsWith( rectangle2 ) )
      {
         rectangle1.Intersect( rectangle2 );
         if (  !rectangle1.IsEmpty )
         {
            e->Graphics->FillRectangle( Brushes::Green, rectangle1 );
         }
      }
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

Rectangle.IsEmpty プロパティのお隣キーワード
検索ランキング

   

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



Rectangle.IsEmpty プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS