Class ImageElement

java.lang.Object
com.dynamicpdf.api.elements.Element
com.dynamicpdf.api.elements.ImageElement

public class ImageElement extends Element
Represents an image element.

This class can be used to place images on a page.

  • Constructor Details

    • ImageElement

      public ImageElement(ImageResource resource, ElementPlacement placement, float xOffset, float yOffset)
      Initializes a new instance of the ImageElement class.
      Parameters:
      resource - ImageResource object containing the image resource.
      placement - The placement of the image on the page.
      xOffset - X coordinate of the image.
      yOffset - Y coordinate of the image.
    • ImageElement

      public ImageElement(ImageResource resource, ElementPlacement placement)
      Initializes a new instance of the ImageElement class.
      Parameters:
      resource - ImageResource object containing the image resource.
      placement - The placement of the image on the page
    • ImageElement

      public ImageElement(String resourceName, ElementPlacement placement, float xOffset, float yOffset)
      Initializes a new instance of the ImageElement class.
      Parameters:
      resourceName - The name of the image resource.
      placement - The placement of the image on the page.
      xOffset - X coordinate of the image.
      yOffset - Y coordinate of the image.
    • ImageElement

      public ImageElement(String resourceName, ElementPlacement placement)
      Initializes a new instance of the ImageElement class.
      Parameters:
      resourceName - The name of the image resource.
      placement - The placement of the image on the page.
  • Method Details

    • getResource

      public Resource getResource()
      Overrides:
      getResource in class Element
    • getScaleX

      public float getScaleX()
      Gets horizontal scale of the image.
      Returns:
      The horizontal scale of the image.
    • setScaleX

      public void setScaleX(float value)
      Sets the horizontal scale of the image.
      Parameters:
      value - The horizontal scale of the image.
    • getScaleY

      public float getScaleY()
      Gets the vertical scale of the image.
      Returns:
      The vertical scale of the image.
    • setScaleY

      public void setScaleY(float value)
      Sets the vertical scale of the image.
      Parameters:
      value - The vertical scale of the image.
    • getMaxHeight

      public float getMaxHeight()
      Gets the maximum height of the image.
      Returns:
      The maximum height of the image.
    • setMaxHeight

      public void setMaxHeight(float value)
      Sets the maximum height of the image.
      Parameters:
      value - The maximum height of the image.
    • getMaxWidth

      public float getMaxWidth()
      Gets the maximum width of the image.
      Returns:
      The maximum width of the image.
    • setMaxWidth

      public void setMaxWidth(float value)
      Sets the maximum width of the image.
      Parameters:
      value - The maximum width of the image.