Rect.Inflate Metoda

Definice

Vytvoří obdélník, který bude výsledkem rozbalení nebo zmenšení obdélníku podle zadané částky.

Přetížení

Inflate(Size)

Rozbalí obdélník pomocí zadaného Sizepříkazu , ve všech směrech.

Inflate(Double, Double)

Rozbalí nebo zmenší obdélník pomocí zadané šířky a výšky ve všechsměrch

Inflate(Rect, Size)

Vrátí obdélník, který má za následek rozbalení zadaného obdélníku zadaným Size, ve všech směrech.

Inflate(Rect, Double, Double)

Vytvoří obdélník, který bude výsledkem rozbalení nebo zmenšení zadaného obdélníku podle zadané šířky a výšky ve všech směrech.

Inflate(Size)

Rozbalí obdélník pomocí zadaného Sizepříkazu , ve všech směrech.

public:
 void Inflate(System::Windows::Size size);
public void Inflate (System.Windows.Size size);
member this.Inflate : System.Windows.Size -> unit
Public Sub Inflate (size As Size)

Parametry

size
Size

Určuje množství, které se má obdélník rozbalit. Vlastnost Size struktury Width určuje množství, které má zvětšit obdélník Left a Right vlastnosti. Vlastnost Size struktury Height určuje množství, které má zvětšit obdélník Top a Bottom vlastnosti.

Výjimky

Tato metoda se volá na obdélníku Empty .

Příklady

Následující příklad ukazuje, jak pomocí Inflate(Size) metody zvětšit velikost obdélníku.

private Size inflateExample1()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200, 50);

    // Use the Inflate method to expand the rectangle by the specified Size in all
    // directions. The new size is 240,110. Note: Width of the resulting rectangle  
    // is increased by twice the Width of the specified Size structure because  
    // both the left and right sides of the rectangle are inflated. Likewise, the 
    // Height of the resulting rectangle is increased by twice the Height of the 
    // specified Size structure.
    myRectangle.Inflate(new Size(20,30));

    return myRectangle.Size;
}

Poznámky

Výsledný Width obdélník se zvýší o dvojnásobek Width zadané Size struktury, protože levé i pravé strany obdélníku jsou nafukovány. Stejně tak se Height výsledný obdélník zvýší o dvojnásobek Height zadané Size struktury.

Viz také

Platí pro

Inflate(Double, Double)

Rozbalí nebo zmenší obdélník pomocí zadané šířky a výšky ve všechsměrch

public:
 void Inflate(double width, double height);
public void Inflate (double width, double height);
member this.Inflate : double * double -> unit
Public Sub Inflate (width As Double, height As Double)

Parametry

width
Double

Velikost, o kterou chcete zvětšit nebo zmenšit levou a pravou stranu obdélníku.

height
Double

Velikost, o kterou chcete zvětšit nebo zmenšit horní a dolní strany obdélníku.

Výjimky

Tato metoda se volá na obdélníku Empty .

Příklady

Následující příklad ukazuje, jak pomocí Inflate(Double, Double) metody změnit velikost obdélníku.

private Size inflateExample2()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200,50);

    // Use the Inflate method to expand or shrink the rectangle by the specified 
    // width and height amounts. The new size is 160,150 (width shrunk by 40 and  
    // height increased by 100). Note: Width of the resulting rectangle is increased 
    // or shrunk by twice the specified width, because both the left and right sides  
    // of the rectangle are inflated or shrunk. Likewise, the height of the resulting 
    // rectangle is increased or shrunk by twice the specified height.
    myRectangle.Inflate(-20,50);

    return myRectangle.Size;
}

Poznámky

Výsledný Width obdélník se zvětší nebo zmenší o dvakrát zadaný posun šířky, protože se použije na levou i pravou stranu obdélníku. Stejně tak se Height výsledný obdélník zvýší nebo sníží o dvakrát zadanou výšku.

Pokud zadaná šířka nebo výška zmenší obdélník více než jeho aktuální Width nebo Height - dát obdélník záporné oblasti - obdélník se stane Empty obdélníkem.

Viz také

Platí pro

Inflate(Rect, Size)

Vrátí obdélník, který má za následek rozbalení zadaného obdélníku zadaným Size, ve všech směrech.

public:
 static System::Windows::Rect Inflate(System::Windows::Rect rect, System::Windows::Size size);
public static System.Windows.Rect Inflate (System.Windows.Rect rect, System.Windows.Size size);
static member Inflate : System.Windows.Rect * System.Windows.Size -> System.Windows.Rect
Public Shared Function Inflate (rect As Rect, size As Size) As Rect

Parametry

rect
Rect

Struktura Rect , která se má upravit.

size
Size

Určuje množství, které se má obdélník rozbalit. Vlastnost Size struktury Width určuje množství, které má zvětšit obdélník Left a Right vlastnosti. Vlastnost Size struktury Height určuje množství, které má zvětšit obdélník Top a Bottom vlastnosti.

Návraty

Rect

Výsledný obdélník.

Výjimky

rectEmpty je obdélník.

Příklady

Následující příklad ukazuje, jak pomocí Inflate(Rect, Size) metody změnit velikost obdélníku.

private Size inflateExample3()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200, 50);

    // Use the static Inflate method to return an expanded version of myRectangle1.   
    // The size of myRectangle2 is 240,110. Note: Width of the resulting rectangle is increased 
    // by twice the Width of the specified Size structure, because both the left and right 
    // sides of the rectangle are inflated. Likewise, the Height of the resulting 
    // rectangle is increased by twice the Height of the specified Size structure.
    Rect myRectangle2 = Rect.Inflate(myRectangle, new Size(20, 30));

    return myRectangle2.Size;
}

Poznámky

Výsledný Width obdélník se zvýší o dvojnásobek Width zadané Size struktury, protože levé i pravé strany obdélníku jsou nafukovány. Stejně tak se Height výsledný obdélník zvýší o dvojnásobek Height zadané Size struktury.

Viz také

Platí pro

Inflate(Rect, Double, Double)

Vytvoří obdélník, který bude výsledkem rozbalení nebo zmenšení zadaného obdélníku podle zadané šířky a výšky ve všech směrech.

public:
 static System::Windows::Rect Inflate(System::Windows::Rect rect, double width, double height);
public static System.Windows.Rect Inflate (System.Windows.Rect rect, double width, double height);
static member Inflate : System.Windows.Rect * double * double -> System.Windows.Rect
Public Shared Function Inflate (rect As Rect, width As Double, height As Double) As Rect

Parametry

rect
Rect

Struktura Rect , která se má upravit.

width
Double

Velikost, o kterou chcete zvětšit nebo zmenšit levou a pravou stranu obdélníku.

height
Double

Velikost, o kterou chcete zvětšit nebo zmenšit horní a dolní strany obdélníku.

Návraty

Rect

Výsledný obdélník.

Výjimky

rectEmpty je obdélník.

Příklady

Následující příklad ukazuje, jak pomocí Inflate(Rect, Double, Double) metody změnit velikost obdélníku.

private Size inflateExample4()
{
    // Initialize new rectangle.
    Rect myRectangle = new Rect();

    // The Location property specifies the coordinates of the upper left-hand 
    // corner of the rectangle. 
    myRectangle.Location = new Point(10, 5);

    // Set the Size property of the rectangle with a width of 200
    // and a height of 50.
    myRectangle.Size = new Size(200, 50);

    // Use the static Inflate method to return a version of myRectangle with a shrunk
    // width and expanded height. The size of myRectangle2 is 160,150. Note: Width of the resulting 
    // rectangle is increased or shrunk by twice the specified width, because both the
    // left and right sides of the rectangle are inflated or shrunk. Likewise, the height 
    // of the resulting rectangle is increased or shrunk by twice the specified height.
    Rect myRectangle2 = Rect.Inflate(myRectangle, -20, 50);

    return myRectangle2.Size;
}

Poznámky

Výsledný Width obdélník se zvětší nebo zmenší o dvakrát zadaný posun šířky, protože se použije na levou i pravou stranu obdélníku. Stejně tak se Height výsledný obdélník zvýší nebo sníží o dvakrát zadanou výšku.

Pokud specifikované modifikátory šířky nebo výšky zmenší obdélník více než jeho aktuální Width nebo Height - dává obdélník záporné oblasti - tato metoda vrátí Rect.Empty.

Viz také

Platí pro