ActivityDesigner.ImageRectangle 屬性

定義

取得影像包圍界線的邏輯座標值,這個影像則與設計工具相關聯。

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

屬性值

Rectangle 影像。

範例

下列範例將示範如何覆寫 ImageRectangle 屬性。 在這個範例中將使用 的繫結計算 。

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 擷取包圍與設計工具相關聯之影像的矩形座標。 您可以使用這些座標來繪製接點或覆疊圖形。

適用於