次の方法で共有


SimpleShape.BackgroundImage プロパティ

形状に表示されるイメージを取得または設定します。

名前空間:  Microsoft.VisualBasic.PowerPacks
アセンブリ:  Microsoft.VisualBasic.PowerPacks.Vs (Microsoft.VisualBasic.PowerPacks.Vs.dll 内)

構文

'宣言
<BrowsableAttribute(True)> _
Public Property BackgroundImage As Image
[BrowsableAttribute(true)]
public Image BackgroundImage { get; set; }
[BrowsableAttribute(true)]
public:
property Image^ BackgroundImage {
    Image^ get ();
    void set (Image^ value);
}
[<BrowsableAttribute(true)>]
member BackgroundImage : Image with get, set
function get BackgroundImage () : Image 
function set BackgroundImage (value : Image)

プロパティ値

型 : Image
Imageを表す図形のバック グラウンドで表示するイメージ。

解説

使用して、BackgroundImageプロパティを図形の上に、グラフィック イメージを配置します。

注意

設定、BackgroundImageプロパティのすべての設定を上書きする、 BackColorBackStyleFillColorFillGradientColorFillGradientStyle、およびFillStyleプロパティです。

継承時の注意

オーバーライドする場合、BackgroundImageプロパティを使用して、派生クラスで、BackgroundImage基本実装を拡張する基本クラスのプロパティです。 それ以外の場合、すべての実装を提供する必要があります。 Get の両方をオーバーライドし、set アクセサーの必要はありません、BackgroundImageプロパティです。必要がある場合に、1 つだけをオーバーライドできます。

次の例を使用する方法を示しています。、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 名前空間

その他の技術情報

ライン コントロールとシェイプ コントロールの概要 (Visual Studio)

方法 : LineShape コントロールを使用して線を描画する (Visual Studio)

方法 : OvalShape コントロールおよび RectangleShape コントロールを使用して図形を描画する (Visual Studio)

方法 : Windows フォームに背景イメージを追加する