Rectangle.Union メソッドとは? わかりやすく解説

Rectangle.Union メソッド

2 つRectangle 構造体和集合格納されている Rectangle 構造体取得します

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

使用例使用例

Union メソッド使用する方法次のコード例示します。この例は、Windows フォームでの使用意図してデザインされています。このコードフォーム貼り付けフォームPaint イベント処理するときに PaintEventArgs の e渡して ShowRectangleUnion メソッド呼び出します。

Private Sub ShowRectangleUnion(ByVal
 e As PaintEventArgs)

    ' Declare two rectangles and draw them.
    Dim rectangle1 As New
 Rectangle(30, 40, 50, 100)
    Dim rectangle2 As New
 Rectangle(50, 60, 100, 60)
    e.Graphics.DrawRectangle(Pens.Sienna, rectangle1)
    e.Graphics.DrawRectangle(Pens.BlueViolet, rectangle2)

    ' Declare a third rectangle as a union of the first two.
    Dim rectangle3 As Rectangle = Rectangle.Union(rectangle1,
 _
        rectangle2)

    ' Fill in the third rectangle in a semi-transparent color.
    Dim transparentColor As Color = Color.FromArgb(40,
 135, 135, 255)
    e.Graphics.FillRectangle(New SolidBrush(transparentColor),
 _
        rectangle3)
End Sub
private void ShowRectangleUnion(PaintEventArgs
 e)
{

    // Declare two rectangles and draw them.
    Rectangle rectangle1 = new Rectangle(30, 40, 50, 100);
    Rectangle rectangle2 = new Rectangle(50, 60, 100, 60);
    e.Graphics.DrawRectangle(Pens.Sienna, rectangle1);
    e.Graphics.DrawRectangle(Pens.BlueViolet, rectangle2);

    // Declare a third rectangle as a union of the first two.
    Rectangle rectangle3 = Rectangle.Union(rectangle1, rectangle2);

    // Fill in the third rectangle in a semi-transparent color.
    Color transparentColor = Color.FromArgb(40, 135, 135, 255);
    e.Graphics.FillRectangle(new SolidBrush(transparentColor),
 rectangle3);
}
private:
   void ShowRectangleUnion( PaintEventArgs^ e )
   {
      // Declare two rectangles and draw them.
      Rectangle rectangle1 = Rectangle(30,40,50,100);
      Rectangle rectangle2 = Rectangle(50,60,100,60);
      e->Graphics->DrawRectangle( Pens::Sienna, rectangle1 );
      e->Graphics->DrawRectangle( Pens::BlueViolet, rectangle2 );

      // Declare a third rectangle as a union of the first two.
      Rectangle rectangle3 = Rectangle::Union( rectangle1, rectangle2 );

      // Fill in the third rectangle in a semi-transparent color.
      Color transparentColor = Color::FromArgb( 40, 135, 135, 255 );
      e->Graphics->FillRectangle( gcnew SolidBrush( transparentColor ), rectangle3
 );
   }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

Rectangle.Union メソッドのお隣キーワード
検索ランキング

   

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



Rectangle.Union メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS