Skip to main content
A newer version of this page is available. .
Tab

ExportBinaryImageSettings.SizeMode Property

Specifies how an image is positioned when it is exported.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

[DefaultValue(ImageSizeMode.Squeeze)]
public ImageSizeMode SizeMode { get; set; }

Property Value

Type Default Description
ImageSizeMode **Squeeze**

One of the ImageSizeMode enumeration values.

Available values:

Name Description
Normal

ImageSizeMode-Normal

The image is placed in the upper-left corner of the Picture Box. The image is clipped if it does not fit into the control’s bounds.

StretchImage

ImageSizeMode-StretchImage

The image is stretched or shrunk to fit into the current Picture Box dimensions.

AutoSize

ImageSizeMode-AutoSize

The Picture Box size is adjusted to that of the image it contains.

CenterImage

This option is obsolete. To achieve the same result, set the XRPictureBox.Sizing property of a Picture Box to ImageSizeMode.Normal and the XRPictureBox.ImageAlignment property to ImageAlignment.MiddleCenter.

ZoomImage

ImageSizeMode-ZoomImage

The image is sized proportionally (without clipping), so that it fits best within the Picture Box dimensions. If the height-to-width ratio of the control and the image are equal, the image will be resized to exactly fit into the control’s dimensions. Otherwise, the closest matching image side (height or width) will be sized to the control, and the other side will be sized proportionally (possibly leaving empty space within the control).

Squeeze

ImageSizeMode-Squeeze

If the Picture Box dimensions exceed that of the image it contains, the image is centered and shown full-size. Otherwise, the image is resized to fit into the control’s dimensions.

Tile

ImageSizeMode-Tile

The image is replicated within the Picture Box starting from the upper-left corner. The image is clipped if it does not fit into the control’s dimensions.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to SizeMode
ASP.NET Controls and MVC Extensions BinaryImageEditProperties
ImageEditProperties
ImageEditPropertiesBase
MVCxBinaryImageEditProperties
MVCxColumnBinaryImageEditProperties
MVCxColumnImageEditProperties
MVCxImageEditProperties
ASP.NET Bootstrap Controls BootstrapBinaryImageEditProperties
BootstrapImageEditProperties

Example

<dx:ASPxGridView ID="grid" runat="server" DataSourceID="MasterDataSource" Width="100%" AutoGenerateColumns="False" KeyFieldName="CategoryID">
     <Columns>
          <dx:GridViewDataTextColumn FieldName="CategoryID" />
          <dx:GridViewDataTextColumn FieldName="CategoryName" />
          <dx:GridViewDataTextColumn FieldName="Description" />
          <dx:GridViewDataBinaryImageColumn FieldName="Picture">
               <PropertiesBinaryImage ImageWidth="120" ImageHeight="80">
                    <ExportImageSettings Width="90" Height="60" SizeMode="AutoSize"/>
               </PropertiesBinaryImage>
          </dx:GridViewDataBinaryImageColumn>
     </Columns>
     ...
</dx:ASPxGridView>
See Also