다음을 통해 공유


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)

속성 값

형식: System.Drawing.Image
Image 도형의 배경에 표시할 이미지를 나타냅니다.

설명

사용은 BackgroundImage 셰이프로 끌어 그래픽 이미지를 저장 하는 속성입니다.

[!참고]

Setting the BackgroundImage property overrides any settings for the BackColor, BackStyle, FillColor, FillGradientColor, FillGradientStyle, and FillStyle properties.

상속자 참고 사항

재정의 하는 경우는 BackgroundImage 속성을 사용 하는 파생된 클래스는 BackgroundImage 기본 구현을 확장 하는 기본 클래스의 속성.그렇지 않으면 사용자가 직접 모두 구현해야 합니다.Get을 무시 하 고 set 접근자의 필요를 BackgroundImage 속성이 없습니다. 필요한 경우 하나를 무시할 수 있습니다.

예제

다음 예제에서는 사용 하는 방법을 보여 줍니다 있는 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 Forms에 배경 이미지 추가