SequentialWorkflowRootDesigner.ImageRectangle 属性

定义

获取与设计器关联的图像的环绕边界值(以逻辑坐标表示)。Gets the value for the enclosing bounds of the image associated with the designer in logical coordinates.

protected:
 virtual property System::Drawing::Rectangle ImageRectangle { System::Drawing::Rectangle get(); };
protected override System.Drawing.Rectangle ImageRectangle { get; }
member this.ImageRectangle : System.Drawing.Rectangle
Protected Overrides ReadOnly Property ImageRectangle As Rectangle

属性值

Rectangle

一个 Rectangle,包含为 Image 显示的 CompositeActivityDesignerA Rectangle that encloses the Image displayed for the CompositeActivityDesigner.

示例

下面的示例演示如何重写 ImageRectangle 属性。The following example shows how to override the ImageRectangle property. 在此示例中,使用 ImageRectangle 的边界来计算 CompositeActivityDesignerIn this example, the ImageRectangle is calculated using the Bounds of the CompositeActivityDesigner.

protected override Rectangle ImageRectangle
{
    get
    {
        Rectangle bounds = this.Bounds;
        Size sz = new Size(24, 24);

        Rectangle imageRect = new Rectangle();
        imageRect.X = bounds.Left + ((bounds.Width - sz.Width) / 2);
        imageRect.Y = bounds.Top + 4;
        imageRect.Size = sz;

        return imageRect;
    }
}
Protected Overrides ReadOnly Property ImageRectangle() As Rectangle

    Get
        Dim Bounds As Rectangle = Me.Bounds
        Dim sz As New Size(24, 24)

        Dim imageRect As New Rectangle()
        imageRect.X = Bounds.Left + ((Bounds.Width - sz.Width) / 2)
        imageRect.Y = Bounds.Top + 4
        imageRect.Size = sz

        Return imageRect
    End Get
End Property

注解

使用 ImageRectangle 可检索包含与设计器关联的图像的矩形的坐标。Use the ImageRectangle to retrieve the coordinates for the rectangle that encloses the image associated with the designer. 可以使用这些坐标绘制连接器或覆盖图形。You can use these coordinates for drawing connectors or overlaying graphics.

适用于