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