Proprietà SimpleShape.BackgroundImageLayout

Aggiornamento: novembre 2007

Ottiene o imposta il layout dell'immagine di sfondo definito nell'enumerazione ImageLayout.

Spazio dei nomi:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintassi

<BrowsableAttribute(True)> _
Public Property BackgroundImageLayout As ImageLayout

Dim instance As SimpleShape
Dim value As ImageLayout

value = instance.BackgroundImageLayout

instance.BackgroundImageLayout = value
[BrowsableAttribute(true)]
public ImageLayout BackgroundImageLayout { get; set; }
[BrowsableAttribute(true)]
public:
property ImageLayout BackgroundImageLayout {
    ImageLayout get ();
    void set (ImageLayout value);
}
public function get BackgroundImageLayout () : ImageLayout
public function set BackgroundImageLayout (value : ImageLayout)

Valore proprietà

Tipo: System.Windows.Forms.ImageLayout

Uno dei valori di ImageLayout (Center, None, Stretch, Tile o Zoom). Tile rappresenta il valore predefinito.

Note

Utilizzare la proprietà BackgroundImageLayout per specificare la posizione e il comportamento di un'immagine aggiunta a un controllo. BackgroundImageLayout ha effetto solo se è impostata la proprietà BackgroundImage.

È possibile aumentare le prestazioni delle immagini di grandi dimensioni se si imposta BackgroundImageLayout su un valore diverso da Tile.

Esempi

Nell'esempio riportato di seguito viene mostrato come utilizzare le proprietà BackgroundImage e BackgroundImageLayout per visualizzare un'immagine in una forma. Per questo esempio è necessario disporre in un form di un controllo OvalShape denominato OvalShape1 e il progetto deve contenere una risorsa immagine denominata Image1.

Private Sub Form1_Load(ByVal sender As System.Object, _
 ByVal e As System.EventArgs) Handles MyBase.Load
    ' Assign an image resource.
    OvalShape1.BackgroundImage = My.Resources.Image1
    ' Resize the image to fit the oval.
    OvalShape1.BackgroundImageLayout = ImageLayout.Stretch
End Sub
private void form1_Load(System.Object sender, System.EventArgs e)
{
    // Assign an image resource.
    ovalShape1.BackgroundImage = SimpleShapeBackGroundImageCS.Properties.Resources.Image1;
    // Resize the image to fit the oval.
    ovalShape1.BackgroundImageLayout = ImageLayout.Stretch;
}

Autorizzazioni

Vedere anche

Riferimenti

SimpleShape Classe

Membri SimpleShape

Spazio dei nomi Microsoft.VisualBasic.PowerPacks

Altre risorse

Introduzione ai controlli Line e Shape (Visual Studio)

Procedura: disegnare linee con il controllo LineShape (Visual Studio)

Procedura: disegnare forme con i controlli OvalShape e RectangleShape (Visual Studio)

Procedura: aggiungere immagini di sfondo a un Windows Form