Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PictureEditOptionsMask.Margin Property

Gets or sets the outer margin of the mask.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[SupportedMaskOption(SupportedMaskOptionKind.NotNone)]
public Padding Margin { get; set; }

#Property Value

Type Description
Padding

The outer margin of the mask.

#Property Paths

You can access this nested property as listed below:

Object Type Path to Margin
RepositoryItemPictureEdit
.OptionsMask .Margin

#Remarks

Using the Margin property you can shift or reduce the boundaries of the mask relative to the target image. Setting the Margin property to positive values squeezes the mask. Once the mask is squeezed, the new display rectangle of the target image is also squeezed. In this case, if the target image is stretched within the PictureEdit control (see RepositoryItemPictureEdit.SizeMode), you will notice that the masked image is zoomed in after the Margin property is set.

Consider the following examples, where the Margin property is set to the default and non-default value, respectively. The image is stretched within the PictureEdit control by setting the RepositoryItemPictureEdit.SizeMode property to Squeeze.

Margin=(0, 0, 0, 0):

PictureEdit-Mask-Margin0.png

Margin=(50, 50, 50, 50):

PictureEdit-Mask-Margin50.png

In the second image, the mask is reduced and thus, the target image is zoomed in, since image stretching is enabled.

To shift the mask relative to the target image, use the PictureEditOptionsMask.Offset property.

See Also