Skip to main content
All docs
V18.2

Overview - Image

Image is an editor for displaying images.

Implementation Details

Image is realized by the ImageEditExtension class. Its instance can be accessed via the ExtensionsFactory.Image helper method, which is used to add an Image extension to a view. This method’s parameter provides access to the Image‘s settings implemented by the ImageEditSettings class, allowing you to fully customize the extension.

The Image‘s client counterpart is represented by the ASPxClientImage object.

Declaration

Image can be added to a view in the following manner.

View code (ASPX):

Image:<br/><br/>

<% 
    Html.DevExpress().Image(
        settings => {
            settings.Name = "image1";

            settings.ImageUrl = "Content/Images/olive.jpg";
        }
    )
    .Render();
%> 

View code (Razor):

Image:<br/><br/>

@Html.DevExpress().Image(
    settings => {
        settings.Name = "image1";

        settings.ImageUrl = "Content/Images/olive.jpg";
    }
).GetHtml()

Note

The Partial View should contain only the extension’s code.

The code result is demonstrated in the image below.

image-declaration.png

See Also