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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Region.GetRegionData メソッドの意味・解説 

Region.GetRegionData メソッド

この Region説明する情報を表す RegionData を返します

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

Public Function GetRegionData As
 RegionData
Dim instance As Region
Dim returnValue As RegionData

returnValue = instance.GetRegionData
public RegionData GetRegionData ()
public:
RegionData^ GetRegionData ()
public RegionData GetRegionData ()
public function GetRegionData () : RegionData

戻り値
この Region説明する情報を表す RegionData

使用例使用例

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

Public Sub GetRegionDataExample(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 a region using the first rectangle.
    Dim myRegion As New
 [Region](regionRect)

    ' Get the RegionData for this region.
    Dim myRegionData As RegionData = myRegion.GetRegionData()
    Dim myRegionDataLength As Integer
 = myRegionData.Data.Length
    DisplayRegionData(e, myRegionDataLength, myRegionData)
End Sub

' Helper Function for GetRegionData.
Public Sub DisplayRegionData(ByVal
 e As PaintEventArgs, ByVal len As
 Integer, _
ByVal dat As RegionData)

    ' Display the result.
    Dim i As Integer
    Dim x As Single = 20
    Dim y As Single = 140
    Dim myFont As New Font("Arial",
 8)
    Dim myBrush As New SolidBrush(Color.Black)
    e.Graphics.DrawString("myRegionData = ", myFont,
 myBrush, _
    New PointF(x, y))
    y = 160
    For i = 0 To len - 1
        If x > 300 Then
            y += 20
            x = 20
        End If
        e.Graphics.DrawString(dat.Data(i).ToString(), myFont, _
        myBrush, New PointF(x, y))
        x += 30
    Next i
End Sub
public void GetRegionDataExample(PaintEventArgs
 e)
{
             
    // Create a rectangle and draw it to the screen in black.
    Rectangle regionRect = new Rectangle(20, 20, 100, 100);
    e.Graphics.DrawRectangle(Pens.Black, regionRect);
             
    // Create a region using the first rectangle.
    Region myRegion = new Region(regionRect);
             
    // Get the RegionData for this region.
    RegionData myRegionData = myRegion.GetRegionData();
    int myRegionDataLength = myRegionData.Data.Length;
    DisplayRegionData(e, myRegionDataLength, myRegionData);
}
             
// THIS IS A HELPER FUNCTION FOR GetRegionData.
public void DisplayRegionData(PaintEventArgs
 e,
    int len,
    RegionData dat)
{
             
    // Display the result.
    int i;
    float x = 20, y = 140;
    Font myFont = new Font("Arial", 8);
    SolidBrush myBrush = new SolidBrush(Color.Black);
    e.Graphics.DrawString("myRegionData = ",
        myFont,
        myBrush,
        new PointF(x, y));
    y = 160;
    for(i = 0; i < len; i++)
    {
        if(x > 300)
        {
            y += 20;
            x = 20;
        }
        e.Graphics.DrawString(dat.Data[i].ToString(),
            myFont,
            myBrush,
            new PointF(x, y));
        x += 30;
    }
}
public:
   void GetRegionDataExample( PaintEventArgs^ e )
   {
      // Create a rectangle and draw it to the screen in black.
      Rectangle regionRect = Rectangle(20,20,100,100);
      e->Graphics->DrawRectangle( Pens::Black, regionRect );

      // Create a region using the first rectangle.
      System::Drawing::Region^ myRegion = gcnew System::Drawing::Region( regionRect
 );

      // Get the RegionData for this region.
      RegionData^ myRegionData = myRegion->GetRegionData();
      int myRegionDataLength = myRegionData->Data->Length;
      DisplayRegionData( e, myRegionDataLength, myRegionData );
   }

   // THIS IS A HELPER FUNCTION FOR GetRegionData.
   void DisplayRegionData( PaintEventArgs^ e, int
 len, RegionData^ dat )
   {
      // Display the result.
      int i;
      float x = 20,y = 140;
      System::Drawing::Font^ myFont = gcnew System::Drawing::Font( "Arial",8
 );
      SolidBrush^ myBrush = gcnew SolidBrush( Color::Black );
      e->Graphics->DrawString( "myRegionData = ", myFont, myBrush,
 PointF(x,y) );
      y = 160;
      for ( i = 0; i < len; i++ )
      {
         if ( x > 300 )
         {
            y += 20;
            x = 20;
         }
         e->Graphics->DrawString( dat->Data[ i ].ToString(), myFont, myBrush,
 PointF(x,y) );
         x += 30;
      }
   }
public void GetRegionDataExample(PaintEventArgs
 e)
{
    // Create a rectangle and draw it to the screen in black.
    Rectangle regionRect = new Rectangle(20, 20, 100, 100);

    e.get_Graphics().DrawRectangle(Pens.get_Black(), regionRect);

    // Create a region using the first rectangle.
    Region myRegion = new Region(regionRect);

    // Get the RegionData for this region.
    RegionData myRegionData = myRegion.GetRegionData();
    int myRegionDataLength = myRegionData.get_Data().length;

    DisplayRegionData(e, myRegionDataLength, myRegionData);
} //GetRegionDataExample

// THIS IS A HELPER FUNCTION FOR GetRegionData.
public void DisplayRegionData(PaintEventArgs
 e, int len, RegionData dat)
{
    // Display the result.
    int i;
    float x = 20;
    float y = 140;
    Font myFont = new Font("Arial", 8);
    SolidBrush myBrush = new SolidBrush(Color.get_Black());

    e.get_Graphics().DrawString("myRegionData = ", myFont, myBrush, 
        new PointF(x, y));
    y = 160;
    for (i = 0; i < len; i++) {
        if (x > 300) {
            y += 20;
            x = 20;
        }

        e.get_Graphics().DrawString(dat.get_Data().get_Item(i).ToString(), 
            myFont, myBrush, new PointF(x, y));
        x += 30;
    }
} //DisplayRegionData
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS