RepositoryItemImageEdit.SizeMode Property
Gets or sets a value specifying how the image is displayed within the image editor.
Namespace: DevExpress.XtraEditors.Repository
Assembly: DevExpress.XtraEditors.v24.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
[DefaultValue(PictureSizeMode.Clip)]
[DXCategory("Behavior")]
public PictureSizeMode SizeMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
PictureSizeMode | Clip | A PictureSizeMode enumeration value. |
Available values:
Name | Description |
---|---|
Clip | A picture is not stretched. |
Stretch | A picture is stretched in order to fit within the area of an editor (or editor’s dropdown window). |
Zoom | A picture is stretched proportionally. The picture fits within the area of an editor (or editor’s dropdown window) at least in one direction. |
StretchHorizontal | A picture is stretched horizontally. Its height remains unchanged. |
StretchVertical | A picture is stretched vertically. Its width remains unchanged. |
Squeeze | An image is displayed as is if its actual size is smaller than the size of the container. If the image size is larger than the container’s size, the image is shrunk proportionally to fit the container’s bounds. |
Remarks
Use the SizeMode property to control how the image is displayed within the editor’s dropdown. It can be displayed as is, stretched to fit the dropdown window or stretched proportionally.
The effect of the size mode can depend upon the RepositoryItemImageEdit.PictureAlignment property setting.
Changing the SizeMode value at runtime raises the RepositoryItem.PropertiesChanged event.
Note
Stretching an image (especially one in bitmap format) can reduce image quality. Metafiles (lists of graphical instructions for drawing images at run time) are better suited for stretching than bitmaps.