Propriedade SimpleShape.BackgroundImageLayout

Obtém ou define o layout da imagem em segundo plano, conforme definido na enumeração ImageLayout.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (em Microsoft.VisualBasic.PowerPacks.Vs.dll)

Sintaxe

'Declaração
<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)

Valor de propriedade

Tipo: System.Windows.Forms.ImageLayout
One of the values of ImageLayout (Center,None, Stretch, Tile, or Zoom). Tile é o valor padrão.

Comentários

Use o BackgroundImageLayout propriedade para especificar a posição e o comportamento de uma imagem que você adicionou a um controle.BackgroundImageLayouttem efeito somente se a BackgroundImage está definida.

Você pode aumentar o desempenho de imagens grandes se você definir BackgroundImageLayout como algo diferente de Tile.

Exemplos

O exemplo a seguir mostra como usar o BackgroundImage e BackgroundImageLayout propriedades para exibir uma imagem em uma forma.Este exemplo requer que você tenha um OvalShape controle denominado OvalShape1 em um formulário e que o seu projeto contém um recurso de imagem denominado 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;
}

Segurança do .NET Framework

Consulte também

Referência

SimpleShape Classe

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

Introdução à linha e controles Shape (Visual Studio)

Como: desenhar linhas com o controle de LineShape (Visual Studio)

Como: desenhar formas com os controles de RectangleShape (Visual Studio) e o OvalShape

Como: adicionar imagens de plano de fundo ao Windows Forms