Rectangle.IsEmpty プロパティ
アセンブリ: System.Drawing (system.drawing.dll 内)

この Rectangle の Width、Height、X、Y の各プロパティがいずれも値ゼロを持っている場合、このプロパティは true を返します。それ以外の場合は false を返します。

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 ); } } }

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に収録されているすべての辞書からRectangle.IsEmpty プロパティを検索する場合は、下記のリンクをクリックしてください。

- Rectangle.IsEmpty プロパティのページへのリンク