ActivityDesigner.Image 属性

定义

获取或设置与设计器关联的 Image

public:  virtual property System::Drawing::Image ^ Image {  public:
System::Drawing::Image ^ get(); protected:
 void set(System::Drawing::Image ^ value); };
public virtual System.Drawing.Image Image { get; protected set; }
member this.Image : System.Drawing.Image with get, set
Public Overridable Property Image As Image

属性值

与设计器关联的 Image

示例

下面的示例演示如何从嵌入的资源加载 Bitmap 对象。 在本例中,ToolboxImage 与基类 ActivityDesigner 绘制自定义 ActivityDesigner 时所使用的图像相同。

protected override void Initialize(Activity activity)
{
    base.Initialize(activity);
    Bitmap bmp = Resources.ToolboxImage;
    bmp.MakeTransparent();
    this.Image = bmp;
}
Protected Overrides Sub Initialize(ByVal activity As Activity)

    MyBase.Initialize(activity)
    Dim bmp As Bitmap = Resources.ToolboxImage
    bmp.MakeTransparent()
    Me.Image = bmp
End Sub

注解

Image 属性设置为要显示的 Image。 可在设计时或运行时执行此操作。

适用于