Rectangle.Inflate メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Rectangle 構造体を指定の量だけ拡大します。
オーバーロード
Inflate(Size) |
この Rectangle を指定の量だけ拡大します。 |
Inflate(Int32, Int32) |
この Rectangle を指定の量だけ拡大します。 |
Inflate(Rectangle, Int32, Int32) |
指定の Rectangle 構造体の拡大したコピーを作成して返します。 コピーは、指定した量だけ拡大されます。 元の Rectangle 構造体は変更されません。 |
Inflate(Size)
- ソース:
- Rectangle.cs
- ソース:
- Rectangle.cs
- ソース:
- Rectangle.cs
この Rectangle を指定の量だけ拡大します。
public:
void Inflate(System::Drawing::Size size);
public void Inflate (System.Drawing.Size size);
member this.Inflate : System.Drawing.Size -> unit
Public Sub Inflate (size As Size)
パラメーター
- size
- Size
この四角形の拡張量。
例
次の例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgse
です。 コードは を Rectangle 作成し、両方の軸で 50 単位拡大します。 四角形は、インフレ前 (黒) とインフレ後 (赤) の画面に描画されます。
public:
void RectangleInflateTest2( PaintEventArgs^ e )
{
// Create a rectangle.
Rectangle rect = Rectangle(100,100,50,50);
// Draw the uninflated rectangle to screen.
e->Graphics->DrawRectangle( Pens::Black, rect );
// Set up the inflate size.
System::Drawing::Size inflateSize = System::Drawing::Size( 50, 50 );
// Call Inflate.
rect.Inflate( inflateSize );
// Draw the inflated rectangle to screen.
e->Graphics->DrawRectangle( Pens::Red, rect );
}
public void RectangleInflateTest2(PaintEventArgs e)
{
// Create a rectangle.
Rectangle rect = new Rectangle(100, 100, 50, 50);
// Draw the uninflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Black, rect);
// Set up the inflate size.
Size inflateSize = new Size(50, 50);
// Call Inflate.
rect.Inflate(inflateSize);
// Draw the inflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Red, rect);
}
Public Sub RectangleInflateTest2(ByVal e As PaintEventArgs)
' Create a rectangle.
Dim rect As New Rectangle(100, 100, 50, 50)
' Draw the uninflated rect to screen.
e.Graphics.DrawRectangle(Pens.Black, rect)
' Set up the inflate size.
Dim inflateSize As New Size(50, 50)
' Call Inflate.
rect.Inflate(inflateSize)
' Draw the inflated rect to screen.
e.Graphics.DrawRectangle(Pens.Red, rect)
End Sub
注釈
このメソッドは、この四角形のコピーではなく、この四角形を拡大します。 四角形は、軸に沿って双方向に拡大されます。 たとえば、50 x 軸で 50 x の四角形を拡大すると、結果の四角形は 150 単位の長さになります (元の 50、負の方向の 50、プラス方向の 50)。
適用対象
Inflate(Int32, Int32)
- ソース:
- Rectangle.cs
- ソース:
- Rectangle.cs
- ソース:
- Rectangle.cs
この Rectangle を指定の量だけ拡大します。
public:
void Inflate(int width, int height);
public void Inflate (int width, int height);
member this.Inflate : int * int -> unit
Public Sub Inflate (width As Integer, height As Integer)
パラメーター
例
次の例では、 構造体を Rectangle 作成し、x 軸方向に 100 単位拡大します。
public:
void RectangleInflateTest3( PaintEventArgs^ e )
{
// Create a rectangle.
Rectangle rect = Rectangle(100,100,50,50);
// Draw the uninflated rectangle to screen.
e->Graphics->DrawRectangle( Pens::Black, rect );
// Call Inflate.
rect.Inflate( 50, 50 );
// Draw the inflated rectangle to screen.
e->Graphics->DrawRectangle( Pens::Red, rect );
}
public void RectangleInflateTest3(PaintEventArgs e)
{
// Create a rectangle.
Rectangle rect = new Rectangle(100, 100, 50, 50);
// Draw the uninflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Black, rect);
// Call Inflate.
rect.Inflate(50, 50);
// Draw the inflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Red, rect);
}
Public Sub RectangleInflateTest3(ByVal e As PaintEventArgs)
' Create a rectangle.
Dim rect As New Rectangle(100, 100, 50, 50)
' Draw the uninflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Black, rect)
' Call Inflate.
rect.Inflate(50, 50)
' Draw the inflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Red, rect)
End Sub
注釈
このメソッドは、この四角形のコピーではなく、この四角形を拡大します。 四角形は、軸に沿って双方向に拡大されます。 たとえば、50 x 軸で 50 x の四角形を拡大すると、結果の四角形は 150 単位の長さになります (元の 50、負の方向の 50、プラス方向の 50)。
または y
がx
負のRectangle場合、構造体は対応する方向に縮小されます。
適用対象
Inflate(Rectangle, Int32, Int32)
- ソース:
- Rectangle.cs
- ソース:
- Rectangle.cs
- ソース:
- Rectangle.cs
public:
static System::Drawing::Rectangle Inflate(System::Drawing::Rectangle rect, int x, int y);
public static System.Drawing.Rectangle Inflate (System.Drawing.Rectangle rect, int x, int y);
static member Inflate : System.Drawing.Rectangle * int * int -> System.Drawing.Rectangle
Public Shared Function Inflate (rect As Rectangle, x As Integer, y As Integer) As Rectangle
パラメーター
戻り値
拡大された Rectangle。
例
次の例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgse
です。 コードは を Rectangle 作成し、両方の軸で 50 単位拡大します。 結果として得られる四角形 (赤) は、両方の軸で 150 単位であることに注意してください。
public:
void RectangleInflateTest( PaintEventArgs^ e )
{
// Create a rectangle.
Rectangle rect = Rectangle(100,100,50,50);
// Draw the uninflated rectangle to screen.
e->Graphics->DrawRectangle( Pens::Black, rect );
// Call Inflate.
Rectangle rect2 = Rectangle::Inflate( rect, 50, 50 );
// Draw the inflated rectangle to screen.
e->Graphics->DrawRectangle( Pens::Red, rect2 );
}
public void RectangleInflateTest(PaintEventArgs e)
{
// Create a rectangle.
Rectangle rect = new Rectangle(100, 100, 50, 50);
// Draw the uninflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Black, rect);
// Call Inflate.
Rectangle rect2 = Rectangle.Inflate(rect, 50, 50);
// Draw the inflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Red, rect2);
}
Public Sub RectangleInflateTest(ByVal e As PaintEventArgs)
' Create a rectangle.
Dim rect As New Rectangle(100, 100, 50, 50)
' Draw the uninflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Black, rect)
' Call Inflate.
Dim rect2 As Rectangle = Rectangle.Inflate(rect, 50, 50)
' Draw the inflated rectangle to screen.
e.Graphics.DrawRectangle(Pens.Red, rect2)
End Sub
注釈
このメソッドは、 の rect
コピーを作成し、コピーを拡大し、拡大コピーを返します。 四角形は、軸に沿って双方向に拡大されます。 たとえば、50 x 軸で 50 x の四角形を拡大すると、結果の四角形は 150 単位の長さになります (元の 50、負の方向の 50、プラス方向の 50)。
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示