GraphicsRenderer

Inheritance: java.lang.Object, com.aspose.imaging.DisposableObject

public class GraphicsRenderer extends DisposableObject

The class handles drawing com.aspose.imaging.Image directly upon the java.awt.Graphic2D. Using this class it is possible to avoid multiple allocations and coping the pixels between com.aspose.Imaging buffers into java.awt.BufferImage in case of VectorImage.

Constructors

ConstructorDescription
GraphicsRenderer(Image image)Creates a new render.
GraphicsRenderer(Image image, ImageOptionsBase exportOptions)Creates a new render.
GraphicsRenderer(Image image, Color backgroundColor, int smoothingMode, int textRendering)Creates a new render.

Methods

MethodDescription
render(Graphics2D graphics)Performs the rendering on the given graphics with scale factor 1.0.
render(Graphics2D graphics, float scaleFactor)Performs the rendering on the given graphics.

GraphicsRenderer(Image image)

public GraphicsRenderer(Image image)

Creates a new render. By default render will be proceed using the SmoothingMode.HighQuality, TextRenderingHint.ClearTypeGridFit, and with a white background color.

Parameters:

ParameterTypeDescription
imageImageThe image which will be rendered on the java.awt.Graphics2D

GraphicsRenderer(Image image, ImageOptionsBase exportOptions)

public GraphicsRenderer(Image image, ImageOptionsBase exportOptions)

Creates a new render.

Parameters:

ParameterTypeDescription
imageImageThe image which will be rendered on the java.awt.Graphics2D
exportOptionsImageOptionsBaseThe export options for adjusting the exporting image.

GraphicsRenderer(Image image, Color backgroundColor, int smoothingMode, int textRendering)

public GraphicsRenderer(Image image, Color backgroundColor, int smoothingMode, int textRendering)

Creates a new render.

Parameters:

ParameterTypeDescription
imageImageThe image which will be rendered on the java.awt.Graphics2D
backgroundColorColorThe background color.
smoothingModeintThe smoothing mode.
textRenderingintThe text rendering mode.

render(Graphics2D graphics)

public void render(Graphics2D graphics)

Performs the rendering on the given graphics with scale factor 1.0.

Parameters:

ParameterTypeDescription
graphicsjava.awt.Graphics2DThe graphics for drawing.

render(Graphics2D graphics, float scaleFactor)

public void render(Graphics2D graphics, float scaleFactor)

Performs the rendering on the given graphics.

Parameters:

ParameterTypeDescription
graphicsjava.awt.Graphics2DThe graphics for drawing.
scaleFactorfloatThe scale factor.