public class RenderingSurfaceAid extends Object
| Constructor and Description |
|---|
RenderingSurfaceAid(int width,
int height,
int pad,
double x0,
double y0,
double x1,
double y1)
Constructs a graphics surface (BufferedImage) and resources for a
coordinate system appropriate for the presentation of a rectangular region
defined by the specified coordinates.
|
RenderingSurfaceAid(int width,
int height,
int pad,
double x0,
double y0,
double x1,
double y1,
boolean alpha)
Constructs a graphics surface (BufferedImage) and resources for a
coordinate system appropriate for the presentation of a rectangular region
defined by the specified coordinates.
|
| Modifier and Type | Method and Description |
|---|---|
void |
drawFrame(Color c) |
void |
fillBackground(Color c) |
BufferedImage |
getBufferedImage()
Gets the buffered image associated with this drawing surface
|
AffineTransform |
getCartesianToPixelTransform()
Gets the affine transform for mapping Cartesian coordinates to pixel
coordinates.
|
Rectangle2D |
getDomainRectangle()
Gets the rectangle for the drawing area corresponding to the coordinate
domain that was specified for the constructor.
|
Graphics2D |
getGraphics2D()
Get the Graphics2D object associated with this drawing surface.
|
double |
getPixelsPerUnit()
Gets the distance in pixels across one unit of distance in
the Cartesian coordinate system.
|
AffineTransform |
getPixelToCartesianTransform()
Gets the affine transform for mapping pixel coordinates to Cartesian
coordinates.
|
double |
getUnitsPerPixel()
Gets the distance across a pixel in the corresponding Cartesian
coordinate system.
|
public RenderingSurfaceAid(int width,
int height,
int pad,
double x0,
double y0,
double x1,
double y1)
Some implementations of the of Java API's ImageIO do not support creating JPEG image files from a BufferedImage with an alpha channel When using this class with Java ImageIO to write JPEG images, the associated BufferedImage should be created without an alpha channel. An alternate constructor is provided for this purpose.
width - the width of the drawing surface, in pixelsheight - the height of the drawing surface, in pixelspad - an arbitrary padding to be added to each side of the rectangle,
in pixelsx0 - Cartesian x coordinate for the lower-left corner of the domainy0 - Cartesian y coordinate for the lower-left corner of the domainx1 - Cartesian x coordinate for the upper-right corner of the domainy1 - Cartesian y coordinate for the upper-right corner of the domainpublic RenderingSurfaceAid(int width,
int height,
int pad,
double x0,
double y0,
double x1,
double y1,
boolean alpha)
When using this class with Java ImageIO to write JPEG images, the associated BufferedImage should be created without an alpha channel. Some implementations of the of Java API's ImageIO do not support creating JPEG image files from a BufferedImage with an alpha channel.
width - the width of the drawing surface, in pixelsheight - the height of the drawing surface, in pixelspad - an arbitrary padding to be added to each side of the rectangle,
in pixelsx0 - Cartesian x coordinate for the lower-left corner of the domainy0 - Cartesian y coordinate for the lower-left corner of the domainx1 - Cartesian x coordinate for the upper-right corner of the domainy1 - Cartesian y coordinate for the upper-right corner of the domainalpha - indicates if the associated image should be created using
an alpha channel.public AffineTransform getCartesianToPixelTransform()
public AffineTransform getPixelToCartesianTransform()
public Rectangle2D getDomainRectangle()
public BufferedImage getBufferedImage()
public Graphics2D getGraphics2D()
public double getUnitsPerPixel()
public double getPixelsPerUnit()
public void fillBackground(Color c)
public void drawFrame(Color c)
Copyright © 2021. All rights reserved.