Back to Devexpress

RepositoryItemImageEdit.SizeMode Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemimageedit.md

latest3.2 KB
Original Source

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.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(PictureSizeMode.Clip)]
[DXCategory("Behavior")]
public PictureSizeMode SizeMode { get; set; }
vb
<DXCategory("Behavior")>
<DefaultValue(PictureSizeMode.Clip)>
Public Property SizeMode As PictureSizeMode

Property Value

TypeDefaultDescription
PictureSizeModeClip

A PictureSizeMode enumeration value.

|

Available values:

NameDescription
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.

See Also

Image

PictureAlignment

RepositoryItemImageEdit Class

RepositoryItemImageEdit Members

DevExpress.XtraEditors.Repository Namespace