public abstract class AbstractGraphics2DAdapter extends Object implements Graphics2DAdapter
| Constructor and Description |
|---|
AbstractGraphics2DAdapter() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
mpt2px(int unit,
int resolution)
Converts millipoints to pixels
|
void |
paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x,
int y,
int width,
int height)
Deprecated.
|
protected BufferedImage |
paintToBufferedImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter,
RendererContext.RendererContextWrapper context,
int resolution,
boolean gray,
boolean withAlpha)
Paints the image to a BufferedImage and returns that.
|
protected void |
setRenderingHintsForBufferedImage(Graphics2D g2d)
Sets rendering hints on the Graphics2D created for painting to a BufferedImage.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpaintImageprotected BufferedImage paintToBufferedImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter, RendererContext.RendererContextWrapper context, int resolution, boolean gray, boolean withAlpha)
painter - the painter which will paint the actual imagecontext - the renderer context for the current rendererresolution - the requested bitmap resolutiongray - true if the generated image should be in grayscaleswithAlpha - true if an alpha channel should be createdprotected int mpt2px(int unit,
int resolution)
unit - the unit to convert in mptsresolution - the target resolutionprotected void setRenderingHintsForBufferedImage(Graphics2D g2d)
g2d - the Graphics2D instancepublic void paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException
paintImage in interface Graphics2DAdapterpainter - the painter which will paint the actual imagecontext - the renderer context for the current rendererx - X position of the imagey - Y position of the imagewidth - width of the imageheight - height of the imageIOException - In case of an I/O error while writing the output formatCopyright © 2025 Apache Software Foundation. All rights reserved.