Interface IImage

All Superinterfaces:
IComponent<IImage>, IHasId<IImage>, IHasTooltip<IImage>, ILinkable<IImage>

public interface IImage extends ILinkable<IImage>, IHasTooltip<IImage>, IComponent<IImage>
  • Method Details

    • setUrl

      IImage setUrl(String url)
      Set the url from which the image shall be fetched
      Parameters:
      url - The url
    • setWidth

      IImage setWidth(int width)
      Set the width of the image in pixels
      Parameters:
      width - The width
    • setHeight

      IImage setHeight(int height)
      Set the height of the image in pixels
      Parameters:
      height - The height
    • setImageData

      void setImageData(byte[] bytes, String contentType)
      Set the bytes of the image along with the format
      Parameters:
      bytes - The bytes
      contentType - File format. E.g. image/png, image/jpg, etc.
    • setObjectFit

      IImage setObjectFit(ObjectFit objetFit)
      Set the `object-fit` CSS property of the image.
      Parameters:
      objetFit -
      Returns:
      the image object
    • constrainBy

      IImage constrainBy(SizeConstraint sizeConstraint)
      Set the size constraint of the image, by restricting the image maximum width, height or both.

      This will make the image preserve its aspect ratio while fitting within the element’s content box. It will not stretch the image to fit the box, but will scale it down if necessary.

      If this is set then an image can be scaled to be smaller than its original size, for example if the page containing the image is resized.

      Parameters:
      sizeConstraint - The size constraint