Class Img

  • All Implemented Interfaces:
    IsCastable

    @JsType(isNative=true,
            name="HTMLImageElement",
            namespace="<global>")
    public final class Img
    extends BaseHtmlElement
    implements IsCastable
    Represents an HTML <img> element, providing the properties and methods used to manipulate image elements.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • getHeight

        @JsProperty
        public int getHeight()
        Returns the value that reflects the height attribute, indicating the rendered height of the image in CSS pixels.
        Returns:
        the value that reflects the height attribute
      • setHeight

        @JsProperty
        public void setHeight​(int height)
        Sets the value that reflects the height attribute, indicating the rendered height of the image in CSS pixels.
        Parameters:
        height - the value that reflects the height attribute
      • getSrc

        @JsProperty
        public String getSrc()
        Returns the full URL of the image including base URI.
        Returns:
        the full URL of the image including base URI
      • setSrc

        @JsProperty
        public void setSrc​(String src)
        Sets the full URL of the image including base URI.
        Parameters:
        src - the full URL of the image including base URI
      • getWidth

        @JsProperty
        public int getWidth()
        Returns the value that reflects the width attribute, indicating the rendered width of the image in CSS pixels.
        Returns:
        the value that reflects the width attribute
      • setWidth

        @JsProperty
        public void setWidth​(int width)
        Sets the value that reflects the width attribute, indicating the rendered width of the image in CSS pixels.
        Parameters:
        width - the value that reflects the width attribute