public class ImageRenderer extends AbstractRenderer
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.
|
Rectangle |
getBorderAreaBBox()
Gets the border box of a renderer.
|
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, 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, 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, transformPoints
protected 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.
layoutContext
- the description of layout area and any other additional information
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.
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)
Copyright © 1998–2017 iText Group NV. All rights reserved.