Graphics.IsVisibleとは? わかりやすく解説

Graphics.IsVisible メソッド (Rectangle)

この Graphics の表示クリップ領域内に、Rectangle 構造体で指定された四角形が含まれるかどうかを示します。

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

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

クリップ領域の内側に小さな赤い四角形が 1 つ生成されます。

Public Sub IsVisibleRectangle(ByVal
 e As PaintEventArgs)

    ' Set clip region.
    Dim clipRegion As New
 [Region](New Rectangle(50, 50, 100, 100))
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Set up coordinates of rectangles.
    Dim rect1 As New Rectangle(100,
 100, 20, 20)
    Dim rect2 As New Rectangle(200,
 200, 20, 20)

    ' If rectangle is visible, fill it.
    If e.Graphics.IsVisible(rect1) Then
        e.Graphics.FillRectangle(New SolidBrush(Color.Red), rect1)
    End If
    If e.Graphics.IsVisible(rect2) Then
        e.Graphics.FillRectangle(New SolidBrush(Color.Blue), rect2)
    End If
End Sub
public void IsVisibleRectangle(PaintEventArgs
 e)
{

    // Set clip region.
    Region clipRegion = new Region(new Rectangle(50,
 50, 100, 100));
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Set up coordinates of rectangles.
    Rectangle rect1 = new Rectangle(100, 100, 20, 20);
    Rectangle rect2 = new Rectangle(200, 200, 20, 20);

    // If rectangle is visible, fill it.
    if (e.Graphics.IsVisible(rect1))
    {
        e.Graphics.FillRectangle(new SolidBrush(Color.Red), rect1);
    }
    if (e.Graphics.IsVisible(rect2))
    {
        e.Graphics.FillRectangle(new SolidBrush(Color.Blue), rect2);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IsVisible メソッド (PointF)

この Graphics の表示クリップ領域内に、指定した PointF 構造体が含まれるかどうかを示します。

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

Public Function IsVisible ( _
    point As PointF _
) As Boolean
public bool IsVisible (
    PointF point
)
public:
bool IsVisible (
    PointF point
)
public boolean IsVisible (
    PointF point
)
public function IsVisible (
    point : PointF
) : boolean

パラメータ

point

表示可能範囲をテストする PointF 構造体。

戻り値
point パラメータで指定された点がこの Graphics の表示クリップ領域内に含まれる場合は true。それ以外の場合は false。

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

クリップ領域の内側に小さな赤い円が 1 つ生成されます。

Public Sub IsVisiblePointF(ByVal
 e As PaintEventArgs)

    ' Set clip region.
    Dim clipRegion As New
 [Region](New Rectangle(50, 50, 100, 100))
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Set up coordinates of points.
    Dim x1 As Single = 100.0F
    Dim y1 As Single = 100.0F
    Dim x2 As Single = 200.0F
    Dim y2 As Single = 200.0F
    Dim point1 As New PointF(x1,
 y1)
    Dim point2 As New PointF(x2,
 y2)

    ' If point is visible, fill ellipse that represents it.
    If e.Graphics.IsVisible(point1) Then
        e.Graphics.FillEllipse(New SolidBrush(Color.Red), x1,
 y1, _
        10.0F, 10.0F)
    End If
    If e.Graphics.IsVisible(point2) Then
        e.Graphics.FillEllipse(New SolidBrush(Color.Blue), x2,
 y2, _
        10.0F, 10.0F)
    End If
End Sub
public void IsVisiblePointF(PaintEventArgs
 e)
{

    // Set clip region.
    Region clipRegion = new Region(new Rectangle(50,
 50, 100, 100));
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Set up coordinates of points.
    float x1 = 100.0F;
    float y1 = 100.0F;
    float x2 = 200.0F;
    float y2 = 200.0F;
    PointF point1 = new PointF(x1, y1);
    PointF point2 = new PointF(x2, y2);

    // If point is visible, fill ellipse that represents it.
    if (e.Graphics.IsVisible(point1))
    {
        e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1,
 y1, 10.0F, 10.0F);
    }
    if (e.Graphics.IsVisible(point2))
    {
        e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2,
 y2, 10.0F, 10.0F);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IsVisible メソッド (RectangleF)

この Graphics の表示クリップ領域内に、RectangleF 構造体で指定された四角形が含まれるかどうかを示します。

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

Public Function IsVisible ( _
    rect As RectangleF _
) As Boolean
Dim instance As Graphics
Dim rect As RectangleF
Dim returnValue As Boolean

returnValue = instance.IsVisible(rect)
public bool IsVisible (
    RectangleF rect
)
public:
bool IsVisible (
    RectangleF rect
)
public boolean IsVisible (
    RectangleF rect
)
public function IsVisible (
    rect : RectangleF
) : boolean

パラメータ

rect

表示可能範囲をテストする RectangleF 構造体。

戻り値
rect パラメータで指定された四角形がこの Graphics の表示クリップ領域内に含まれる場合は true。それ以外の場合は false。

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

クリップ領域の内側に小さな赤い四角形が 1 つ生成されます。

Public Sub IsVisibleRectangleF(ByVal
 e As PaintEventArgs)

    ' Set clip region.
    Dim clipRegion As New
 [Region](New Rectangle(50, 50, 100, 100))
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Set up coordinates of rectangles.
    Dim rect1 As New RectangleF(100.0F,
 100.0F, 20.0F, 20.0F)
    Dim rect2 As New RectangleF(200.0F,
 200.0F, 20.0F, 20.0F)

    ' If rectangle is visible, fill it.
    If e.Graphics.IsVisible(rect1) Then
        e.Graphics.FillRectangle(New SolidBrush(Color.Red), rect1)
    End If
    If e.Graphics.IsVisible(rect2) Then
        e.Graphics.FillRectangle(New SolidBrush(Color.Blue), rect2)
    End If
End Sub
public void IsVisibleRectangleF(PaintEventArgs
 e)
{

    // Set clip region.
    Region clipRegion = new Region(new Rectangle(50,
 50, 100, 100));
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Set up coordinates of rectangles.
    RectangleF rect1 = new RectangleF(100.0F, 100.0F, 20.0F, 20.0F);
    RectangleF rect2 = new RectangleF(200.0F, 200.0F, 20.0F, 20.0F);

    // If rectangle is visible, fill it.
    if (e.Graphics.IsVisible(rect1))
    {
        e.Graphics.FillRectangle(new SolidBrush(Color.Red), rect1);
    }
    if (e.Graphics.IsVisible(rect2))
    {
        e.Graphics.FillRectangle(new SolidBrush(Color.Blue), rect2);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IsVisible メソッド (Int32, Int32)

座標ペアで指定された点が、この Graphics の表示クリップ領域内にあるかどうかを示します。

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

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

クリップ領域の内側に小さな赤い円が 1 つ生成されます。

Public Sub IsVisibleInt(ByVal
 e As PaintEventArgs)

    ' Set clip region.
    Dim clipRegion As New
 [Region](New Rectangle(50, 50, 100, 100))
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Set up coordinates of points.
    Dim x1 As Integer =
 100
    Dim y1 As Integer =
 100
    Dim x2 As Integer =
 200
    Dim y2 As Integer =
 200

    ' If point is visible, fill ellipse that represents it.
    If e.Graphics.IsVisible(x1, y1) Then
        e.Graphics.FillEllipse(New SolidBrush(Color.Red), x1,
 y1, _
        10, 10)
    End If
    If e.Graphics.IsVisible(x2, y2) Then
        e.Graphics.FillEllipse(New SolidBrush(Color.Blue), x2,
 y2, _
        10, 10)
    End If
End Sub
public void IsVisibleInt(PaintEventArgs e)
{

    // Set clip region.
    Region clipRegion = new Region(new Rectangle(50,
 50, 100, 100));
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Set up coordinates of points.
    int x1 = 100;
    int y1 = 100;
    int x2 = 200;
    int y2 = 200;

    // If point is visible, fill ellipse that represents it.
    if (e.Graphics.IsVisible(x1, y1))
    {
        e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1,
 y1, 10, 10);
    }
    if (e.Graphics.IsVisible(x2, y2))
    {
        e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2,
 y2, 10, 10);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IsVisible メソッド (Single, Single)

座標ペアで指定された点が、この Graphics の表示クリップ領域内にあるかどうかを示します。

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

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

クリップ領域の内側に小さな赤い円が 1 つ生成されます。

Public Sub IsVisibleFloat(ByVal
 e As PaintEventArgs)

    ' Set clip region.
    Dim clipRegion As New
 [Region](New Rectangle(50, 50, 100, 100))
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Set up coordinates of points.
    Dim x1 As Single = 100.0F
    Dim y1 As Single = 100.0F
    Dim x2 As Single = 200.0F
    Dim y2 As Single = 200.0F

    ' If point is visible, fill ellipse that represents it.
    If e.Graphics.IsVisible(x1, y1) Then
        e.Graphics.FillEllipse(New SolidBrush(Color.Red), x1,
 y1, _
        10.0F, 10.0F)
    End If
    If e.Graphics.IsVisible(x2, y2) Then
        e.Graphics.FillEllipse(New SolidBrush(Color.Blue), x2,
 y2, _
        10.0F, 10.0F)
    End If
End Sub
public void IsVisibleFloat(PaintEventArgs e)
{

    // Set clip region.
    Region clipRegion = new Region(new Rectangle(50,
 50, 100, 100));
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Set up coordinates of points.
    float x1 = 100.0F;
    float y1 = 100.0F;
    float x2 = 200.0F;
    float y2 = 200.0F;

    // If point is visible, fill ellipse that represents it.
    if (e.Graphics.IsVisible(x1, y1))
    {
        e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1,
 y1, 10.0F, 10.0F);
    }
    if (e.Graphics.IsVisible(x2, y2))
    {
        e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2,
 y2, 10.0F, 10.0F);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IsVisible メソッド (Int32, Int32, Int32, Int32)

この Graphics の表示クリップ領域内に、座標ペア、幅、および高さで指定された四角形が含まれるかどうかを示します。

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

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

クリップ領域の内側に小さな赤い四角形が 1 つ生成されます。

Public Sub IsVisible4Int(ByVal
 e As PaintEventArgs)

    ' Set clip region.
    Dim clipRegion As New
 [Region](New Rectangle(50, 50, 100, 100))
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Set up coordinates of rectangles.
    Dim x1 As Integer =
 100
    Dim y1 As Integer =
 100
    Dim width1 As Integer
 = 20
    Dim height1 As Integer
 = 20
    Dim x2 As Integer =
 200
    Dim y2 As Integer =
 200
    Dim width2 As Integer
 = 20
    Dim height2 As Integer
 = 20

    ' If rectangle is visible, fill it.
    If e.Graphics.IsVisible(x1, y1, width1, height1) Then
        e.Graphics.FillRectangle(New SolidBrush(Color.Red), x1,
 y1, _
        width1, height1)
    End If
    If e.Graphics.IsVisible(x2, y2, width2, height2) Then
        e.Graphics.FillRectangle(New SolidBrush(Color.Blue), x2,
 y2, _
        width2, height2)
    End If
End Sub
public void IsVisible4Int(PaintEventArgs e)
{

    // Set clip region.
    Region clipRegion = new Region(new Rectangle(50,
 50, 100, 100));
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Set up coordinates of rectangles.
    int x1 = 100;
    int y1 = 100;
    int width1 = 20;
    int height1 = 20;
    int x2 = 200;
    int y2 = 200;
    int width2 = 20;
    int height2 = 20;

    // If rectangle is visible, fill it.
    if (e.Graphics.IsVisible(x1, y1, width1, height1))
    {
        e.Graphics.FillRectangle(new SolidBrush(Color.Red), x1,
 y1, width1, height1);
    }
    if (e.Graphics.IsVisible(x2, y2, width2, height2))
    {
        e.Graphics.FillRectangle(new SolidBrush(Color.Blue), x2,
 y2, width2, height2);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IsVisible メソッド (Single, Single, Single, Single)

この Graphics の表示クリップ領域内に、座標ペア、幅、および高さで指定された四角形が含まれるかどうかを示します。

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

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

クリップ領域の内側に小さな赤い四角形が 1 つ生成されます。

Public Sub IsVisible4Float(ByVal
 e As PaintEventArgs)

    ' Set clip region.
    Dim clipRegion As New
 [Region](New Rectangle(50, 50, 100, 100))
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Set up coordinates of rectangles.
    Dim x1 As Single = 100.0F
    Dim y1 As Single = 100.0F
    Dim width1 As Single
 = 20.0F
    Dim height1 As Single
 = 20.0F
    Dim x2 As Single = 200.0F
    Dim y2 As Single = 200.0F
    Dim width2 As Single
 = 20.0F
    Dim height2 As Single
 = 20.0F

    ' If rectangle is visible, fill it.
    If e.Graphics.IsVisible(x1, y1, width1, height1) Then
        e.Graphics.FillRectangle(New SolidBrush(Color.Red), x1,
 y1, _
        width1, height1)
    End If
    If e.Graphics.IsVisible(x2, y2, width2, height2) Then
        e.Graphics.FillRectangle(New SolidBrush(Color.Blue), x2,
 y2, _
        width2, height2)
    End If
End Sub
public void IsVisible4Float(PaintEventArgs
 e)
{

    // Set clip region.
    Region clipRegion = new Region(new Rectangle(50,
 50, 100, 100));
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Set up coordinates of rectangles.
    float x1 = 100.0F;
    float y1 = 100.0F;
    float width1 = 20.0F;
    float height1 = 20.0F;
    float x2 = 200.0F;
    float y2 = 200.0F;
    float width2 = 20.0F;
    float height2 = 20.0F;

    // If rectangle is visible, fill it.
    if (e.Graphics.IsVisible(x1, y1, width1, height1))
    {
        e.Graphics.FillRectangle(new SolidBrush(Color.Red), x1,
 y1, width1, height1);
    }
    if (e.Graphics.IsVisible(x2, y2, width2, height2))
    {
        e.Graphics.FillRectangle(new SolidBrush(Color.Blue), x2,
 y2, width2, height2);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IsVisible メソッド (Point)

この Graphics の表示クリップ領域内に、指定した Point 構造体が含まれるかどうかを示します。

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

使用例使用例

次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。

クリップ領域の内側に小さな赤い円が 1 つ生成されます。

Public Sub IsVisiblePoint(ByVal
 e As PaintEventArgs)

    ' Set clip region.
    Dim clipRegion As New
 [Region](New Rectangle(50, 50, 100, 100))
    e.Graphics.SetClip(clipRegion, CombineMode.Replace)

    ' Set up coordinates of points.
    Dim x1 As Integer =
 100
    Dim y1 As Integer =
 100
    Dim x2 As Integer =
 200
    Dim y2 As Integer =
 200
    Dim point1 As New Point(x1,
 y1)
    Dim point2 As New Point(x2,
 y2)

    ' If point is visible, fill ellipse that represents it.
    If e.Graphics.IsVisible(point1) Then
        e.Graphics.FillEllipse(New SolidBrush(Color.Red), x1,
 y1, _
        10, 10)
    End If
    If e.Graphics.IsVisible(point2) Then
        e.Graphics.FillEllipse(New SolidBrush(Color.Blue), x2,
 y2, _
        10, 10)
    End If
End Sub
public void IsVisiblePoint(PaintEventArgs e)
{

    // Set clip region.
    Region clipRegion = new Region(new Rectangle(50,
 50, 100, 100));
    e.Graphics.SetClip(clipRegion, CombineMode.Replace);

    // Set up coordinates of points.
    int x1 = 100;
    int y1 = 100;
    int x2 = 200;
    int y2 = 200;
    Point point1 = new Point(x1, y1);
    Point point2 = new Point(x2, y2);

    // If point is visible, fill ellipse that represents it.
    if (e.Graphics.IsVisible(point1))
    {
        e.Graphics.FillEllipse(new SolidBrush(Color.Red), x1,
 y1, 10, 10);
    }
    if (e.Graphics.IsVisible(point2))
    {
        e.Graphics.FillEllipse(new SolidBrush(Color.Blue), x2,
 y2, 10, 10);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.IsVisible メソッド

座標ペアで指定された点が、この Graphics の表示クリップ領域内にあるかどうかを示します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
Graphics.IsVisible (Point) この Graphics の表示クリップ領域内に、指定した Point 構造体が含まれるかどうかを示します。
Graphics.IsVisible (PointF) この Graphics の表示クリップ領域内に、指定した PointF 構造体が含まれるかどうかを示します。
Graphics.IsVisible (Rectangle) この Graphics の表示クリップ領域内に、Rectangle 構造体で指定された四角形が含まれるかどうかを示します。
Graphics.IsVisible (RectangleF) この Graphics の表示クリップ領域内に、RectangleF 構造体で指定された四角形が含まれるかどうかを示します。
Graphics.IsVisible (Int32, Int32) 座標ペアで指定された点が、この Graphics の表示クリップ領域内にあるかどうかを示します。
Graphics.IsVisible (Single, Single) 座標ペアで指定された点が、この Graphics の表示クリップ領域内にあるかどうかを示します。
Graphics.IsVisible (Int32, Int32, Int32, Int32) この Graphics の表示クリップ領域内に、座標ペア、幅、および高さで指定された四角形が含まれるかどうかを示します。
Graphics.IsVisible (Single, Single, Single, Single) この Graphics の表示クリップ領域内に、座標ペア、幅、および高さで指定された四角形が含まれるかどうかを示します。
参照参照



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「Graphics.IsVisible」の関連用語

Graphics.IsVisibleのお隣キーワード
検索ランキング

   

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



Graphics.IsVisibleのページの著作権

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

©2026 GRAS Group, Inc.RSS