public final class ImageWriter extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getUniqueName(String original,
String ext)
Gets a unique filename by appending .# after the name to prevent
a file overwrite.
|
static void |
saveImage(String name,
BufferedImage image)
Saves the image as a png with the given name in the specified path
by
ProfileGraph2D . |
static void |
saveImage(String path,
String name,
BufferedImage image)
Saves the image as a png with the gaiven name in the specified path.
|
public static void saveImage(String name, BufferedImage image)
ProfileGraph2D
.name
- name of the image (no path, no extension)image
- image to savepublic static void saveImage(String path, String name, BufferedImage image)
path
- file path to save the image toname
- file name of the image (no path, no extension)image
- image to savepublic static String getUniqueName(String original, String ext)
original
- original name of the file to check uniqueness
(includes path but not extension)ext
- extension of original fileCopyright © 2015. All rights reserved.