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, parent, positionedRenderers, properties| Constructor and Description |
|---|
ImageRenderer(Image image)
Creates an ImageRenderer from its corresponding layout object.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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, alignChildHorizontally, applyAbsolutePosition, applyAction, applyBorderBox, applyBorderBox, applyDestination, applyDestinationsAndAnnotation, applyLinkAnnotation, applyMargins, applyMargins, applyPaddings, applyPaddings, applyRelativePositioningTranslation, beginElementOpacityApplying, calculateAbsolutePdfBBox, calculateBBox, calculateShiftToPositionBBoxOfPointsAt, deleteOwnProperty, deleteProperty, drawBackground, drawBorder, drawChildren, endElementOpacityApplying, getBorders, getChildRenderers, getDefaultProperty, getFirstYLineRecursively, getInnerAreaBBox, getMargins, getModelElement, getOccupiedArea, getOccupiedAreaBBox, getOwnProperties, getOwnProperty, getPaddings, getParent, getProperty, getProperty, getPropertyAsBoolean, getPropertyAsColor, getPropertyAsFloat, getPropertyAsFloat, getPropertyAsFont, getPropertyAsInteger, getPropertyAsTransparentColor, hasOwnOrModelProperty, hasOwnProperty, hasProperty, initElementAreas, isAbsolutePosition, isFixedLayout, isFlushed, isKeepTogether, isNotFittingHeight, isNotFittingLayoutArea, isPositioned, isRelativePosition, isStaticLayout, overrideHeightProperties, rectangleToPointsList, retrieveHeight, retrieveMaxHeight, retrieveMinHeight, retrieveUnitValue, retrieveWidth, setBorders, setParent, setProperty, toString, transformPointsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddChild, getChildRenderers, getModelElement, getOccupiedArea, 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)
IRenderer
LayoutResult, 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)
AbstractRenderer
PdfDocument etc.
draw in interface IRenderer
draw in class AbstractRenderer
drawContext - 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 drawing
public IRenderer getNextRenderer()
IRenderer
IRenderer.layout(LayoutContext) is called more than once.
getNextRenderer in interface IRenderer
public Rectangle getBorderAreaBBox()
AbstractRenderer
getBorderAreaBBox in class AbstractRenderer
public void move(float dxRight,
float dyUp)
AbstractRenderer
move in interface IRenderer
move in class AbstractRenderer
dxRight - 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.
protected ImageRenderer autoScale(LayoutArea layoutArea)
public float getAscent()
ILeafElementRenderer
ILeafElementRenderer extends to.
getAscent in interface ILeafElementRenderer
ILeafElementRenderer
public float getDescent()
ILeafElementRenderer
ILeafElementRenderer extends to.
getDescent in interface ILeafElementRenderer
ILeafElementRenderer
Copyright © 1998–2017 iText Group NV. All rights reserved.