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 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks 命名空間
其他資源
Line 和 Shape 控制項簡介 (Visual Studio)
如何:使用 LineShape 控制項繪製線條 (Visual Studio)