Package org.zkoss.stateless.sul

## Interface IImage

- All Superinterfaces:
    `IAnyGroup<IImage>`, `IComponent<IImage>`, `IHtmlBasedComponent<IImage>`, `IImageBase<IImage>`, `IXulElement<IImage>`

      public interface IImage
      extends IImageBase<IImage>, IAnyGroup<IImage>

  Immutable `Image` component

  An IImage component is used to display an image at the browser. There are two ways to assign an image to an image component. First, you could use the `of(String)` or `IImageBase.withSrc(String)` to specify a URI where the image is located. This approach is similar to what HTML supports. It is useful if you want to display a static image, or any image that can be identified by URL. For example:

       @RichletMapping("/example")
       public IComponent example() {
           return IImage.of("/stateless/ZK-Logo.gif");
       }

  Secondly, you could use the `IImageBase.withContent(org.zkoss.image.Image)` or `IImageBase.withContent(RenderedImage)` method to set the content of an image to an image component directly.

  Author:
    katherine
  See Also:
    `Image`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IImage.Builder` | Builds instances of type `IImage`.
    `static class` | `IImage.Updater` | Builds an updater of type `IImage` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IImage` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `static IImage` | `of​(java.lang.String src)` | Returns the instance with the given `src`.
    `static IImage` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static IImagemap` | `ofSize​(java.lang.String width, java.lang.String height)` | Returns the instance with the given `width` and `height`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IImageBase

      `getContent, getHover, getSrc, isPreloadImage, withContent, withContent, withHover, withPreloadImage, withSrc`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IXulElement

      `getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip`

- - ### Field Detail

    - #### DEFAULT

          static final IImage DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zul.wgt.Image"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IImage>`

    - #### of

          static IImage of​(java.lang.String src)

      Returns the instance with the given `src`.
      Parameters:
        `src` - The URI of the image source.

    - #### ofSize

          static IImagemap ofSize​(java.lang.String width,
                                  java.lang.String height)

      Returns the instance with the given `width` and `height`.
      Parameters:
        `width` - The width of the image.
        `height` - The height of the image.

    - #### ofId

          static IImage ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component