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

<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)

Valor de propriedade

Tipo: System.Windows.Forms.ImageLayout
Um dos valores de ImageLayout (Center , None, Stretch, Tile, ou 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. BackgroundImageLayout tem efeito somente se o BackgroundImage propriedade é definida.

Você pode aumentar o desempenho para grandes imagens se você conjunto 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 chamado OvalShape1 em um formulário e que seu projeto contém um recurso de imagem denominado Image1.

PrivateSub Form1_Load(ByVal sender As System.Object, _
 ByVal e As System.EventArgs) HandlesMyBase.Load
    ' Assign an image resource.
    OvalShape1.BackgroundImage = My.Resources.Image1
    ' Resize the image to fit the oval.
    OvalShape1.BackgroundImageLayout = ImageLayout.Stretch
EndSub
privatevoid 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;
}

Permissões

Consulte também

Referência

SimpleShape Classe

Membros SimpleShape

Namespace Microsoft.VisualBasic.PowerPacks

Outros recursos

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

Como: Desenhar linhas com o Controlarar de LineShape (Visual Studio)

Como: Desenhar formas com a OvalShape e controles de RectangleShape (Visual Studio)

Como: Adicionar imagens de plano de fundo ao Windows Forms