ActivityDesigner.ImageRectangle Property


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

Namespace:   System.Workflow.ComponentModel.Design
Assembly:  System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)

protected virtual Rectangle ImageRectangle { get; }

Property Value

Type: System.Drawing.Rectangle

A Rectangle image.

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.

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

protected override Rectangle ImageRectangle
        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;

.NET Framework
Available since 3.0
Return to top