Rectangle.Inflate Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Zvětší strukturu o zadanou Rectangle částku.
Přetížení
| Name | Description |
|---|---|
| Inflate(Size) |
Zvětší tuto Rectangle hodnotu o zadanou částku. |
| Inflate(Int32, Int32) |
Zvětší tuto Rectangle hodnotu o zadanou částku. |
| Inflate(Rectangle, Int32, Int32) |
Vytvoří a vrátí zvětšenou kopii zadané Rectangle struktury. Kopie se zvětší o zadanou částku. Původní Rectangle struktura zůstává nezměněná. |
Inflate(Size)
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
Zvětší tuto Rectangle hodnotu o zadanou částku.
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)
Parametry
- size
- Size
Množství nafouknutí tohoto obdélníku.
Příklady
Následující příklad je určen pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód vytvoří Rectangle a zvětší ho o 50 jednotek v obou osách. Obdélník se nakreslí na obrazovku před inflace (černou) a po inflace (červená).
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
Poznámky
Tato metoda zvětší tento obdélník, nikoli jeho kopii. Obdélník se zvětší v obou směrech podél osy. Pokud je například obdélník o 50 o 50 zvětšen o 50 na ose x, bude výsledný obdélník dlouhý 150 jednotek (původní 50, 50 ve směru minus a 50 ve směru plus) zachovácí geometrický střed obdélníku.
Platí pro
Inflate(Int32, Int32)
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
Zvětší tuto Rectangle hodnotu o zadanou částku.
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)
Parametry
Příklady
Následující příklad vytvoří Rectangle strukturu a zvětší ji o 100 jednotek ve směru osy x:
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
Poznámky
Tato metoda zvětší tento obdélník, nikoli jeho kopii. Obdélník se zvětší v obou směrech podél osy. Pokud je například obdélník o 50 o 50 zvětšen o 50 na ose x, bude výsledný obdélník dlouhý 150 jednotek (původní 50, 50 ve směru minus a 50 ve směru plus) zachovácí geometrický střed obdélníku.
Pokud je nebo xy je záporná, Rectangle struktura je deflated v odpovídajícím směru.
Platí pro
Inflate(Rectangle, Int32, Int32)
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- Rectangle.cs
- Zdroj:
- 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
Parametry
Návraty
Zvětšený Rectangle.
Příklady
Následující příklad je určen pro použití s model Windows Forms a vyžaduje PaintEventArgse, což je parametr obslužné rutiny Paint události. Kód vytvoří Rectangle a zvětší ho o 50 jednotek v obou osách. Všimněte si, že výsledný obdélník (červený) je v obou osách 150 jednotek.
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
Poznámky
Tato metoda vytvoří kopii rect, zvětší kopii a poté vrátí zvětšenou kopii. Obdélník se zvětší v obou směrech podél osy. Pokud je například obdélník o 50 o 50 zvětšen o 50 na ose x, bude výsledný obdélník dlouhý 150 jednotek (původní 50, 50 ve směru minus a 50 ve směru plus) zachovácí geometrický střed obdélníku.