Package com.dynamicpdf.api.elements
Class ImageElement
java.lang.Object
com.dynamicpdf.api.elements.Element
com.dynamicpdf.api.elements.ImageElement
Represents an image element.
This class can be used to place images on a page.
-
Constructor Summary
ConstructorDescriptionImageElement(ImageResource resource, ElementPlacement placement)
Initializes a new instance of theImageElement
class.ImageElement(ImageResource resource, ElementPlacement placement, float xOffset, float yOffset)
Initializes a new instance of theImageElement
class.ImageElement(String resourceName, ElementPlacement placement)
Initializes a new instance of theImageElement
class.ImageElement(String resourceName, ElementPlacement placement, float xOffset, float yOffset)
Initializes a new instance of theImageElement
class. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Gets the maximum height of the image.float
Gets the maximum width of the image.float
Gets horizontal scale of the image.float
Gets the vertical scale of the image.void
setMaxHeight(float value)
Sets the maximum height of the image.void
setMaxWidth(float value)
Sets the maximum width of the image.void
setScaleX(float value)
Sets the horizontal scale of the image.void
setScaleY(float value)
Sets the vertical scale of the image.Methods inherited from class com.dynamicpdf.api.elements.Element
getEvenPages, getOddPages, getPlacement, getTextFont, getXOffset, getYOffset, setEvenPages, setOddPages, setPlacement, setXOffset, setYOffset
-
Constructor Details
-
ImageElement
public ImageElement(ImageResource resource, ElementPlacement placement, float xOffset, float yOffset)Initializes a new instance of theImageElement
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
Initializes a new instance of theImageElement
class.- Parameters:
resource
-ImageResource
object containing the image resource.placement
- The placement of the image on the page
-
ImageElement
Initializes a new instance of theImageElement
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
Initializes a new instance of theImageElement
class.- Parameters:
resourceName
- The name of the image resource.placement
- The placement of the image on the page.
-
-
Method Details
-
getResource
- Overrides:
getResource
in classElement
-
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.
-