共用方式為


SimpleShape.BackgroundImageLayout 屬性

取得或設定在 ImageLayout 列舉型別中定義的背景影像配置。

命名空間:  Microsoft.VisualBasic.PowerPacks
組件:  Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

語法

'宣告
<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)

屬性值

類型:ImageLayout
ImageLayout 的其中一個值 (Center、None、Stretch、Tile 或 Zoom)。Tile 為預設值。

備註

使用BackgroundImageLayout屬性,以指定的位置和您已加入至控制項之影像的行為。 BackgroundImageLayout才會生效BackgroundImage屬性設定。

您可以增加大型映像的效能,如果您設定BackgroundImageLayout成以外Tile

範例

下列範例示範如何使用BackgroundImage和BackgroundImageLayout圖形上顯示影像的屬性。 此範例中您需要OvalShape控制項命名為 OvalShape1 在表單上的和您的專案包含名為 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;
}

.NET Framework 安全性

請參閱

參考

SimpleShape 類別

Microsoft.VisualBasic.PowerPacks 命名空間

其他資源

Line 和 Shape 控制項簡介 (Visual Studio)

如何:使用 LineShape 控制項繪製線條 (Visual Studio)

如何:使用 OvalShape 和 RectangleShape 控制項繪製圖案 (Visual Studio)

如何:將背景影像加入至 Windows Form