Region コンストラクタとは? わかりやすく解説

Region コンストラクタ (Rectangle)

指定Rectangle 構造体から新しRegion初期化します。

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

解説解説
使用例使用例

Region コンストラクタと MakeEmpty メソッド使用方法を示すコード例次に示します。この例は、Windows フォームでの使用意図してデザインされています。フォーム作成し次のコード貼り付けます。フォームPaint イベント処理メソッドFillEmptyRegion メソッド呼び出しe を PaintEventArgs として渡します

Private Sub FillEmptyRegion(ByVal
 e As PaintEventArgs)

    ' Create a region from a rectangle.
    Dim originalRectangle As New
 Rectangle(40, 40, 40, 50)
    Dim smallRegion As New
 Region(originalRectangle)

    ' Call MakeEmpty.
    smallRegion.MakeEmpty()

    ' Fill the region in red and draw the original rectangle
    ' in black. Note there is nothing filled in.
    e.Graphics.FillRegion(Brushes.Red, smallRegion)
    e.Graphics.DrawRectangle(Pens.Black, originalRectangle)

End Sub
private void FillEmptyRegion(PaintEventArgs
 e)
{

    // Create a region from a rectangle.
    Rectangle originalRectangle = new Rectangle(40, 40, 40, 50);
    Region smallRegion = new Region(originalRectangle);

    // Call MakeEmpty.
    smallRegion.MakeEmpty();

    // Fill the region in red and draw the original rectangle
    // in black. Note there is nothing filled in.
    e.Graphics.FillRegion(Brushes.Red, smallRegion);
    e.Graphics.DrawRectangle(Pens.Black, originalRectangle);

}
private:
   void FillEmptyRegion( PaintEventArgs^ e )
   {
      // Create a region from a rectangle.
      Rectangle originalRectangle = Rectangle(40,40,40,50);
      System::Drawing::Region^ smallRegion = gcnew System::Drawing::Region( originalRectangle
 );

      // Call MakeEmpty.
      smallRegion->MakeEmpty();

      // Fill the region in red and draw the original rectangle
      // in black. Note there is nothing filled in.
      e->Graphics->FillRegion( Brushes::Red, smallRegion );
      e->Graphics->DrawRectangle( Pens::Black, originalRectangle );
   }
private void FillEmptyRegion(PaintEventArgs
 e)
{
    // Create a region from a rectangle.
    Rectangle originalRectangle = new Rectangle(40, 40, 40, 50);
    Region smallRegion = new Region(originalRectangle);

    // Call MakeEmpty.
    smallRegion.MakeEmpty();

    // Fill the region in red and draw the original rectangle
    // in black. Note there is nothing filled in.
    e.get_Graphics().FillRegion(Brushes.get_Red(), smallRegion);
    e.get_Graphics().DrawRectangle(Pens.get_Black(), originalRectangle);
} //FillEmptyRegion
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Region コンストラクタ (RegionData)

指定データから新しRegion初期化します。

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

Public Sub New ( _
    rgnData As RegionData _
)
Dim rgnData As RegionData

Dim instance As New Region(rgnData)
public Region (
    RegionData rgnData
)
public:
Region (
    RegionData^ rgnData
)
public Region (
    RegionData rgnData
)
public function Region (
    rgnData : RegionData
)

パラメータ

rgnData

新しRegion内部定義する RegionData。

例外例外
例外種類条件

ArgumentNullException

rgnDatanull 参照 (Visual Basic では Nothing) です。

解説解説

このメソッドは、内部既存Region定義した新しRegion作成しますrgnData パラメータは、既存Region の定義を含んだ配列です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Region コンストラクタ (RectangleF)


Region コンストラクタ


Region コンストラクタ (GraphicsPath)

指定した GraphicsPath使用して新しRegion初期化します。

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

Public Sub New ( _
    path As GraphicsPath _
)
public Region (
    GraphicsPath path
)
public:
Region (
    GraphicsPath^ path
)
public Region (
    GraphicsPath path
)
public function Region (
    path : GraphicsPath
)

パラメータ

path

新しRegion定義する GraphicsPath。

例外例外
例外種類条件

ArgumentNullException

pathnull 参照 (Visual Basic では Nothing) です。

解説解説

このメソッドは、GraphicsPath使用して新しRegion作成します新し領域は、path パラメータ指定されGraphicsPath内部として定義されます。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Region コンストラクタ ()



このページでは「.NET Framework クラス ライブラリ リファレンス」からRegion コンストラクタを検索した結果を表示しています。
Weblioに収録されているすべての辞書からRegion コンストラクタを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からRegion コンストラクタを検索

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

辞書ショートカット

すべての辞書の索引

「Region コンストラクタ」の関連用語

Region コンストラクタのお隣キーワード
検索ランキング

   

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



Region コンストラクタのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS