Interface IImage
- All Superinterfaces:
IComponent<IImage>
,IHasId<IImage>
,IHasTooltip<IImage>
,ILinkable<IImage>
-
Method Summary
Modifier and TypeMethodDescriptionconstrainBy
(SizeConstraint sizeConstraint) Set the size constraint of the image, by restricting the image maximum width, height or both.setHeight
(int height) Set the height of the image in pixelsvoid
setImageData
(byte[] bytes, String contentType) Set the bytes of the image along with the formatsetObjectFit
(ObjectFit objetFit) Set the `object-fit` CSS property of the image.Set the url from which the image shall be fetchedsetWidth
(int width) Set the width of the image in pixelsMethods inherited from interface com.persequor.extension.frontend.data.IComponent
half, quarter, setGridWidth, setHidden, sixth, third, twelfth, twoThirds
Methods inherited from interface com.persequor.extension.frontend.data.IHasTooltip
setTooltip, setTooltip
-
Method Details
-
setUrl
Set the url from which the image shall be fetched- Parameters:
url
- The url
-
setWidth
Set the width of the image in pixels- Parameters:
width
- The width
-
setHeight
Set the height of the image in pixels- Parameters:
height
- The height
-
setImageData
Set the bytes of the image along with the format- Parameters:
bytes
- The bytescontentType
- File format. E.g. image/png, image/jpg, etc.
-
setObjectFit
Set the `object-fit` CSS property of the image.- Parameters:
objetFit
-- Returns:
- the image object
-
constrainBy
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
-