public final class GraphicsUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static BufferedImage |
convertRenderedImage(RenderedImage img)
Converts a rendered image to a
BufferedImage. |
static Shape |
copyOf(Shape shape)
Returns a shape that is (more or less) equivalent to the supplied shape.
|
static GeneralPath |
createPolygon(int[] xPoints,
int[] yPoints,
int nPoints,
boolean close)
Creates a polygon from the specified
x and y coordinate
arrays. |
public static Shape copyOf(Shape shape)
Line2D,
Rectangle2D, RoundRectangle2D, Arc2D,
Ellipse2D, and Polygon) the copy will be an instance of
that class. For other shapes, a Path2D containing the outline
of the shape is returned.shape - the shape (null not permitted).null).public static GeneralPath createPolygon(int[] xPoints, int[] yPoints, int nPoints, boolean close)
x and y coordinate
arrays.xPoints - the x-points.yPoints - the y-points.nPoints - the number of points to use for the polyline.close - closed?public static BufferedImage convertRenderedImage(RenderedImage img)
BufferedImage. This utility
method has come from a forum post by Jim Moore at:
img - the rendered image.Copyright © 2016. All rights reserved.