public class ImageRenderer extends AbstractRenderer implements ILeafElementRenderer
| Modifier and Type | Field and Description |
|---|---|
protected float |
deltaX |
protected Float |
fixedXPosition |
protected Float |
fixedYPosition |
protected float |
imageHeight |
protected float |
imageWidth |
protected float |
pivotY |
childRenderers, EPS, flushed, INF, isLastRendererForModelElement, modelElement, occupiedArea, OVERLAP_EPSILON, parent, positionedRenderers, properties| Constructor and Description |
|---|
ImageRenderer(Image image)
Creates an ImageRenderer from its corresponding layout object.
|
| Modifier and Type | Method and Description |
|---|---|
protected Rectangle |
applyPaddings(Rectangle rect,
UnitValue[] paddings,
boolean reverse)
Applies given paddings on the given rectangle
|
protected ImageRenderer |
autoScale(LayoutArea layoutArea) |
void |
draw(DrawContext drawContext)
Flushes the renderer subtree contents, i.e.
|
float |
getAscent()
Gets the maximum offset above the base line that this
ILeafElementRenderer extends to. |
Rectangle |
getBorderAreaBBox()
Gets the border box of a renderer.
|
float |
getDescent()
Gets the maximum offset below the base line that this
ILeafElementRenderer extends to. |
MinMaxWidth |
getMinMaxWidth() |
IRenderer |
getNextRenderer()
Gets a new instance of this class to be used as a next renderer, after this renderer is used, if
IRenderer.layout(LayoutContext) is called more than once. |
LayoutResult |
layout(LayoutContext layoutContext)
This method simulates positioning of the renderer, including all of its children, and returns
the
LayoutResult, representing the layout result, including occupied area, status, i.e. |
void |
move(float dxRight,
float dyUp)
Moves the renderer subtree by the specified offset.
|
addAllProperties, addChild, alignChildHorizontally, allowLastYLineRecursiveExtraction, applyAbsolutePosition, applyAction, applyBorderBox, applyBorderBox, applyDestination, applyDestinationsAndAnnotation, applyLinkAnnotation, applyMargins, applyMargins, applyPaddings, applyRelativePositioningTranslation, beginElementOpacityApplying, beginTransformationIfApplied, calculateAbsolutePdfBBox, calculateBBox, calculateShiftToPositionBBoxOfPointsAt, clipBackgroundArea, clipBackgroundArea, clipBorderArea, createXObject, deleteOwnProperty, deleteProperty, drawBackground, drawBorder, drawChildren, endElementOpacityApplying, endTransformationIfApplied, getBackgroundArea, getBorderRadii, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getLastYLineRecursively, getMargins, getModelElement, getOccupiedArea, getOccupiedAreaBBox, getOwnProperties, getOwnProperty, getPaddings, getParent, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsColor, getPropertyAsFloat, getPropertyAsFloat, getPropertyAsFont, getPropertyAsInteger, getPropertyAsTransparentColor, getPropertyAsUnitValue, hasAbsoluteUnitValue, hasOwnOrModelProperty, hasOwnProperty, hasProperty, hasRelativeUnitValue, initElementAreas, isAbsolutePosition, isBorderBoxSizing, isFirstOnRootArea, isFixedLayout, isFlushed, isKeepTogether, isNotFittingHeight, isNotFittingLayoutArea, isNotFittingWidth, isOverflowFit, isOverflowProperty, isOverflowProperty, isOverflowProperty, isPositioned, isRelativePosition, isStaticLayout, rectangleToPointsList, retrieveHeight, retrieveMaxHeight, retrieveMaxWidth, retrieveMinHeight, retrieveMinWidth, retrieveUnitValue, retrieveUnitValue, retrieveWidth, setBorders, setMinMaxWidthBasedOnFixedWidth, setParent, setProperty, toString, transformPoints, updateHeight, updateHeightsOnSplit, updateMaxHeight, updateMinHeight, updateWidthclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddChild, getChildRenderers, getModelElement, getOccupiedArea, getParent, getProperty, isFlushed, setParentdeleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setPropertyprotected Float fixedXPosition
protected Float fixedYPosition
protected float pivotY
protected float deltaX
protected float imageWidth
protected float imageHeight
public LayoutResult layout(LayoutContext layoutContext)
IRendererLayoutResult, representing the layout result, including occupied area, status, i.e.
if there was enough place to fit the renderer subtree, etc.
LayoutResult can be extended to return custom layout results for custom elements, e.g.
TextRenderer uses TextLayoutResult as its result.
This method can be called standalone to learn how much area the renderer subtree needs, or can be called
before IRenderer.draw(DrawContext), to prepare the renderer to be flushed to the output stream.public void draw(DrawContext drawContext)
AbstractRendererPdfDocument etc.draw in interface IRendererdraw in class AbstractRendererdrawContext - contains the PdfDocument to which the renderer subtree if flushed,
the PdfCanvas on which the renderer subtree is drawn and other additional parameters
needed to perform drawingpublic IRenderer getNextRenderer()
IRendererIRenderer.layout(LayoutContext) is called more than once.getNextRenderer in interface IRendererpublic Rectangle getBorderAreaBBox()
AbstractRenderergetBorderAreaBBox in class AbstractRendererprotected Rectangle applyPaddings(Rectangle rect, UnitValue[] paddings, boolean reverse)
AbstractRendererapplyPaddings in class AbstractRendererrect - a rectangle paddings will be applied on.paddings - the paddings to be applied on the given rectanglereverse - indicates whether paddings will be applied
inside (in case of false) or outside (in case of false) the rectangle.border box of the rendererpublic void move(float dxRight,
float dyUp)
AbstractRenderermove in interface IRenderermove in class AbstractRendererdxRight - the x-axis offset in points. Positive value will move the renderer subtree to the right.dyUp - the y-axis offset in points. Positive value will move the renderer subtree to the top.public MinMaxWidth getMinMaxWidth()
getMinMaxWidth in class AbstractRendererprotected ImageRenderer autoScale(LayoutArea layoutArea)
public float getAscent()
ILeafElementRendererILeafElementRenderer extends to.getAscent in interface ILeafElementRendererILeafElementRendererpublic float getDescent()
ILeafElementRendererILeafElementRenderer extends to.getDescent in interface ILeafElementRendererILeafElementRendererCopyright © 1998–2020 iText Group NV. All rights reserved.