Share via


ActivityDesigner.ImageRectangle Propriedade

Definição

Obtém o valor para os limites da imagem associada ao designer em coordenadas lógicas.

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

Valor da propriedade

Rectangle

Uma Rectangle imagem.

Exemplos

O exemplo a seguir mostra como substituir a ImageRectangle propriedade. Neste exemplo, o ImageRectangle valor é calculado usando os Limites do 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

Comentários

Use as ImageRectangle coordenadas para recuperar o retângulo que inclui a imagem associada ao designer. Você pode usar essas coordenadas para desenhar conectores ou sobrepor elementos gráficos.

Aplica-se a