Skip to main content

BadgeDefaultProperties.ImageStretchMargins Property

Gets or sets the image region that can be stretched.

Namespace: DevExpress.Utils.VisualEffects

Assembly: DevExpress.Utils.v24.2.dll

Declaration

[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public Padding? ImageStretchMargins { get; set; }

Property Value

Type Default Description
Nullable<Padding> *null*

A Padding structure that is the image stretch region.

Remarks

When the BadgeDefaultProperties.StretchImage property is set to DefaultBoolean.True, the badge BadgeDefaultProperties.Image is automatically stretched to fit the badge BadgeDefaultProperties.Text. If the image has a complex shape (e.g., rounded corners), stretching these parts may cause them look blurry. For best visual results, you can use the ImageStretchMargins property to set left, top, right and bottom stretch margins for the image. After you do so, only the central image region will be able to stretch. Parts of the image that belong to the margins’ outer border will remain untouched.

For instance, your badge has an arrow image. The figure below illustrates custom stretch margins that will force this arrow to stretch only its tail, while its head will be displayed as is.

AdornerManager - Stretch Margins Scheme

The difference between this arrow, stretched with and without using stretch margins, is shown below.

AdornerManager - Stretch Margins Comparison

The ImageStretchMargins property has priority over the BadgeProperties.ImageStretchMargins property that affects all badges within this AdornerUIManager. If the ImageStretchMargins property is not set, individual badges inherit this global setting.

Note

Default badge images (circles) do not require setting custom stretch margins. For these images, stretch margins are set automatically.

See Also