public class ImageUtils extends Object
| Constructor and Description |
|---|
ImageUtils() |
| Modifier and Type | Method and Description |
|---|---|
static BufferedImage |
centeredSubImage(BufferedImage bufferedImage,
int w,
int h) |
static BufferedImage |
createImage(int width,
int height) |
static BufferedImage |
crop(BufferedImage bufferedImage,
int w,
int h) |
static BufferedImage |
cropBottom(BufferedImage bufferedImage,
int percentage) |
static BufferedImage |
cropRect(BufferedImage bufferedImage) |
static BufferedImage |
cropRect(BufferedImage bufferedImage,
float ratio) |
static BufferedImage |
cropRect(BufferedImage bufferedImage,
float ratio,
boolean centered) |
static BufferedImage |
drawImage(BufferedImage img1,
BufferedImage img2) |
static BufferedImage |
drawImage(BufferedImage img1,
BufferedImage img2,
int x,
int y,
int w,
int h) |
static BufferedImage |
drawImage(BufferedImage img1,
File file) |
static BufferedImage |
drawImage(BufferedImage img1,
String file) |
static BufferedImage |
drawImage(BufferedImage img1,
String file,
int x,
int y,
int w,
int h) |
static BufferedImage |
drawSubImage(BufferedImage img1,
BufferedImage img2,
int x,
int y,
int w,
int h) |
static BufferedImage |
drawSubImage(BufferedImage image,
String file,
int x,
int y,
int w,
int h) |
static BufferedImage |
drawText(BufferedImage image,
String s,
int x,
int y,
int width,
int height,
float linespace,
Font font,
Color color) |
static BufferedImage |
expand(BufferedImage img,
int w,
int h) |
static BufferedImage |
expand(BufferedImage img,
int w,
int h,
int x,
int y) |
static void |
fillRect(BufferedImage image,
Color color) |
static void |
fillRect(BufferedImage image,
Color color,
int x,
int y,
int w,
int h) |
static Rectangle2D |
getTextBound(BufferedImage image,
String s,
Font font) |
static boolean |
hasAlpha(Image image) |
static BufferedImage |
letterbox(BufferedImage bufferedImage,
int width,
int height) |
static BufferedImage |
letterbox(BufferedImage bufferedImage,
int width,
int height,
Color backColor) |
static Image |
mask(BufferedImage img,
Color color) |
static BufferedImage |
open(File file) |
static BufferedImage |
open(InputStream in) |
static BufferedImage |
open(String filename) |
static BufferedImage |
open(URL url) |
static BufferedImage |
rotate(BufferedImage img,
double angle) |
static void |
saveAs(BufferedImage bufferedImage,
File file) |
static void |
saveAs(BufferedImage bufferedImage,
String fileName) |
static void |
saveAs(BufferedImage bufferedImage,
String format,
OutputStream out) |
static void |
saveAsJpeg(BufferedImage image,
int quality,
OutputStream out) |
static void |
saveAsJpeg(BufferedImage image,
int quality,
String dest) |
static BufferedImage |
scale(BufferedImage bufferedImage,
float percent) |
static BufferedImage |
scale(BufferedImage bufferedImage,
int w,
int h) |
static BufferedImage |
scaleHeight(BufferedImage bufferedImage,
int h) |
static BufferedImage |
scaleWidth(BufferedImage bufferedImage,
int w) |
static BufferedImage |
subImage(BufferedImage bufferedImage,
int x1,
int y1,
int x2,
int y2) |
public static BufferedImage rotate(BufferedImage img, double angle)
public static Image mask(BufferedImage img, Color color)
public static BufferedImage cropRect(BufferedImage bufferedImage)
public static BufferedImage cropRect(BufferedImage bufferedImage, float ratio)
public static BufferedImage createImage(int width, int height)
public static BufferedImage letterbox(BufferedImage bufferedImage, int width, int height) throws Exception
Exceptionpublic static BufferedImage letterbox(BufferedImage bufferedImage, int width, int height, Color backColor) throws Exception
Exceptionpublic static BufferedImage drawImage(BufferedImage img1, BufferedImage img2, int x, int y, int w, int h)
public static BufferedImage drawImage(BufferedImage img1, BufferedImage img2)
public static BufferedImage drawImage(BufferedImage img1, String file) throws Exception
Exceptionpublic static BufferedImage drawImage(BufferedImage img1, String file, int x, int y, int w, int h) throws Exception
Exceptionpublic static BufferedImage drawImage(BufferedImage img1, File file) throws Exception
Exceptionpublic static BufferedImage drawSubImage(BufferedImage image, String file, int x, int y, int w, int h) throws IOException
IOExceptionpublic static BufferedImage drawSubImage(BufferedImage img1, BufferedImage img2, int x, int y, int w, int h)
public static BufferedImage expand(BufferedImage img, int w, int h)
public static BufferedImage expand(BufferedImage img, int w, int h, int x, int y)
public static void fillRect(BufferedImage image, Color color)
public static void fillRect(BufferedImage image, Color color, int x, int y, int w, int h)
public static BufferedImage cropRect(BufferedImage bufferedImage, float ratio, boolean centered)
public static BufferedImage cropBottom(BufferedImage bufferedImage, int percentage)
public static BufferedImage crop(BufferedImage bufferedImage, int w, int h)
public static BufferedImage subImage(BufferedImage bufferedImage, int x1, int y1, int x2, int y2)
public static BufferedImage centeredSubImage(BufferedImage bufferedImage, int w, int h)
public static BufferedImage scaleHeight(BufferedImage bufferedImage, int h) throws Exception
Exceptionpublic static BufferedImage scaleWidth(BufferedImage bufferedImage, int w) throws Exception
Exceptionpublic static BufferedImage scale(BufferedImage bufferedImage, int w, int h) throws Exception
Exceptionpublic static BufferedImage scale(BufferedImage bufferedImage, float percent) throws Exception
Exceptionpublic static void saveAs(BufferedImage bufferedImage, File file) throws IOException
IOExceptionpublic static void saveAs(BufferedImage bufferedImage, String fileName) throws IOException
IOExceptionpublic static void saveAs(BufferedImage bufferedImage, String format, OutputStream out) throws IOException
IOExceptionpublic static BufferedImage open(String filename) throws IOException
IOExceptionpublic static BufferedImage open(File file) throws IOException
IOExceptionpublic static BufferedImage open(InputStream in) throws IOException
IOExceptionpublic static BufferedImage open(URL url) throws IOException
IOExceptionpublic static void saveAsJpeg(BufferedImage image, int quality, String dest) throws Exception
Exceptionpublic static void saveAsJpeg(BufferedImage image, int quality, OutputStream out) throws Exception
Exceptionpublic static Rectangle2D getTextBound(BufferedImage image, String s, Font font)
public static BufferedImage drawText(BufferedImage image, String s, int x, int y, int width, int height, float linespace, Font font, Color color)
Copyright © 2015. All rights reserved.