CompositeActivityDesigner.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

屬性值

矩形,會將針對 Image 所顯示的 CompositeActivityDesigner 包圍起來。A rectangle that encloses the Image displayed for the CompositeActivityDesigner.

範例

下列範例將示範如何覆寫 ImageRectangle 屬性。The following example shows how to override the ImageRectangle property. 在這個範例中將使用 ImageRectangleCompositeActivityDesigner的繫結計算 。In 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.

適用於