Region.Intersect メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
オーバーロード
Intersect(GraphicsPath) |
この Region をそれ自体と指定の GraphicsPath の交差部分に更新します。 |
Intersect(Rectangle) | |
Intersect(RectangleF) |
この Region をそれ自体と指定の RectangleF 構造体の交差部分に更新します。 |
Intersect(Region) |
Intersect(GraphicsPath)
- ソース:
- Region.cs
- ソース:
- Region.cs
- ソース:
- Region.cs
この Region をそれ自体と指定の GraphicsPath の交差部分に更新します。
public:
void Intersect(System::Drawing::Drawing2D::GraphicsPath ^ path);
public void Intersect (System.Drawing.Drawing2D.GraphicsPath path);
member this.Intersect : System.Drawing.Drawing2D.GraphicsPath -> unit
Public Sub Intersect (path As GraphicsPath)
パラメーター
- path
- GraphicsPath
この Region と交差する GraphicsPath。
例
コード例については、 メソッドと Complement(GraphicsPath) メソッドをRectangleF.Intersect(RectangleF)参照してください。
適用対象
Intersect(Rectangle)
- ソース:
- Region.cs
- ソース:
- Region.cs
- ソース:
- Region.cs
public:
void Intersect(System::Drawing::Rectangle rect);
public void Intersect (System.Drawing.Rectangle rect);
member this.Intersect : System.Drawing.Rectangle -> unit
Public Sub Intersect (rect As Rectangle)
パラメーター
例
コード例については、 メソッドを Intersect(RectangleF) 参照してください。
適用対象
Intersect(RectangleF)
- ソース:
- Region.cs
- ソース:
- Region.cs
- ソース:
- Region.cs
この Region をそれ自体と指定の RectangleF 構造体の交差部分に更新します。
public:
void Intersect(System::Drawing::RectangleF rect);
public void Intersect (System.Drawing.RectangleF rect);
member this.Intersect : System.Drawing.RectangleF -> unit
Public Sub Intersect (rect As RectangleF)
パラメーター
- rect
- RectangleF
この Region と交差する RectangleF 構造体。
例
次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgse
です。 コードは、次のアクションを実行します。
最初の四角形を作成し、黒で画面に描画します。
2 番目の四角形を作成し、赤で画面に描画します。
最初の四角形から領域を作成します。
2 番目の四角形と組み合わせた場合の領域の交差領域を取得します。
交差領域を青で塗りつぶし、画面に描画します。
領域と四角形の重複する領域のみが青であることに注意してください。
public:
void Intersect_RectF_Example( PaintEventArgs^ e )
{
// Create the first rectangle and draw it to the screen in black.
Rectangle regionRect = Rectangle(20,20,100,100);
e->Graphics->DrawRectangle( Pens::Black, regionRect );
// create the second rectangle and draw it to the screen in red.
RectangleF complementRect = RectangleF(90,30,100,100);
e->Graphics->DrawRectangle( Pens::Red, Rectangle::Round( complementRect ) );
// Create a region using the first rectangle.
System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( regionRect );
// Get the area of intersection for myRegion when combined with
// complementRect.
myRegion->Intersect( complementRect );
// Fill the intersection area of myRegion with blue.
SolidBrush^ myBrush = gcnew SolidBrush( Color::Blue );
e->Graphics->FillRegion( myBrush, myRegion );
}
public void Intersect_RectF_Example(PaintEventArgs e)
{
// Create the first rectangle and draw it to the screen in black.
Rectangle regionRect = new Rectangle(20, 20, 100, 100);
e.Graphics.DrawRectangle(Pens.Black, regionRect);
// create the second rectangle and draw it to the screen in red.
RectangleF complementRect = new RectangleF(90, 30, 100, 100);
e.Graphics.DrawRectangle(Pens.Red,
Rectangle.Round(complementRect));
// Create a region using the first rectangle.
Region myRegion = new Region(regionRect);
// Get the area of intersection for myRegion when combined with
// complementRect.
myRegion.Intersect(complementRect);
// Fill the intersection area of myRegion with blue.
SolidBrush myBrush = new SolidBrush(Color.Blue);
e.Graphics.FillRegion(myBrush, myRegion);
}
Public Sub Intersect_RectF_Example(ByVal e As PaintEventArgs)
' Create the first rectangle and draw it to the screen in black.
Dim regionRect As New Rectangle(20, 20, 100, 100)
e.Graphics.DrawRectangle(Pens.Black, regionRect)
' create the second rectangle and draw it to the screen in red.
Dim complementRect As New RectangleF(90, 30, 100, 100)
e.Graphics.DrawRectangle(Pens.Red, _
Rectangle.Round(complementRect))
' Create a region using the first rectangle.
Dim myRegion As New [Region](regionRect)
' Get the area of intersection for myRegion when combined with
' complementRect.
myRegion.Intersect(complementRect)
' Fill the intersection area of myRegion with blue.
Dim myBrush As New SolidBrush(Color.Blue)
e.Graphics.FillRegion(myBrush, myRegion)
End Sub
適用対象
Intersect(Region)
- ソース:
- Region.cs
- ソース:
- Region.cs
- ソース:
- Region.cs
public:
void Intersect(System::Drawing::Region ^ region);
public void Intersect (System.Drawing.Region region);
member this.Intersect : System.Drawing.Region -> unit
Public Sub Intersect (region As Region)
パラメーター
例
コード例については、 メソッドと Complement(GraphicsPath) メソッドに関するページをIntersect(RectangleF)参照してください。.
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示