This documentation is archived and is not being maintained.

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.

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;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0