CompositeActivityDesigner.ImageRectangle Property

Definition

Gets the value for the enclosing bounds of the image associated with the designer in logical coordinates.

C#
protected override System.Drawing.Rectangle ImageRectangle { get; }

Property Value

A rectangle that encloses the Image displayed for the CompositeActivityDesigner.

Examples

The following example shows how to override the ImageRectangle property. In this example, the ImageRectangle is calculated using the Bounds of the CompositeActivityDesigner.

C#
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;
    }
}

Remarks

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.

Applies to

Produkt Verzie
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1