Share via


ActivityDesigner.ImageRectangle Proprietà

Definizione

Ottiene un valore per i limiti di inclusione dell'immagine associata alla finestra di progettazione nelle coordinate logiche.

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

Valore della proprietà

Immagine Rectangle.

Esempio

Nell'esempio seguente viene illustrato come eseguire l'override della proprietà ImageRectangle. In questo esempio ImageRectangle viene calcolato utilizzando i limiti della classe ActivityDesigner.

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

Commenti

Utilizzare ImageRectangle per recuperare le coordinate per il rettangolo che racchiude l'immagine associata alla finestra di progettazione. È possibile utilizzare tali coordinate per disegnare connettori o di elementi grafici sovrapposti.

Si applica a