Proprietà SimpleShape.BackgroundImageLayout
Ottiene o imposta il layout dell'immagine di sfondo definito in ImageLayout enumerazione.
Spazio dei nomi: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintassi
'Dichiarazione
<BrowsableAttribute(True)> _
Public Property BackgroundImageLayout As ImageLayout
[BrowsableAttribute(true)]
public ImageLayout BackgroundImageLayout { get; set; }
[BrowsableAttribute(true)]
public:
property ImageLayout BackgroundImageLayout {
ImageLayout get ();
void set (ImageLayout value);
}
[<BrowsableAttribute(true)>]
member BackgroundImageLayout : ImageLayout with get, set
function get BackgroundImageLayout () : ImageLayout
function set BackgroundImageLayout (value : ImageLayout)
Valore proprietà
Tipo: System.Windows.Forms.ImageLayout
Uno dei valori di ImageLayout (Center,None, Stretch, Tile, o Zoom). Tile il valore predefinito è.
Note
utilizzare BackgroundImageLayout proprietà per specificare la posizione e il comportamento di un'immagine aggiunto a un controllo.BackgroundImageLayout ha effetto solo se BackgroundImage la proprietà è impostata su.
È possibile aumentare le prestazioni per le grandi immagini se si imposta BackgroundImageLayout un nome diverso da Tile.
Esempi
Nell'esempio seguente viene illustrato come utilizzare BackgroundImage e BackgroundImageLayout proprietà per visualizzare un'immagine in una forma.Questo esempio presuppone che l'utente abbia OvalShape controllare OvalShape1 denominato in un form e che il progetto contiene una risorsa immagine denominata Image1.
Private Sub Form1_Load() 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;
}
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per ulteriori informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
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)