StaticImage Class

An abstract class representing a View Item that displays a static image.

Namespace: DevExpress.ExpressApp.Editors

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public abstract class StaticImage :
    ViewItem,
    IDisposable
Public MustInherit Class StaticImage
    Inherits ViewItem
    Implements IDisposable

The StaticImage class is an abstract class from which all the Static Image View Items derive (for WinForms, Web and Mobile applications). The class itself derives from the ViewItem class responsible for implementing basic functionality for items in a Detail View.

Add a Default Static Image

To add a Static Image View Item to a Detail View, use the Model Editor.

  • Navigate to Views | <DetailView> | Items.
  • Right-click the node and select Add... | StaticImage.

    StaticImage

  • Specify the ImageName and Id properties for the newly added item. You can select an image from the Image gallery. Click the ellipsis button (EllipsisButton) on the right of the property value when the ImageName property is focused and browse the available images.

    StaticImageProperties

  • Then, proceed to the Views | <DetailView> | Layout node and customize the Detail View's layout.

    StaticImageLayout

Add a Custom Static Image

You may need to implement a custom Static Image View Item with a specific image-displaying control.

  • Add a public class that inherits from StaticImage to a UI-specific module project.
  • Override the protected virtual CreateControlCore method and return an instance of the required control.
  • Apply the ViewItemAttributeto the custom item. This will add a child node to the ViewItems node in the Application Model.

For more information, refer to the View Items and Implement Custom View Items topics.

Customize a Static Image's Size Options

If a StaticImage is displayed incorrectly in your application, choose the appropriate ImageSizeMode in the Model Editor. SizeMode

For SVG images, you can also specify SvgImageHeight and SvgImageWidth. These properties work only with the following ImageSizeMode values: AutoSize, CenterImage, or Normal.

See Also