public abstract class ImageOpt extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ImageOpt.ImageTextInfo |
| 限定符和类型 | 方法和说明 |
|---|---|
static BufferedImage |
addTextToImage(BufferedImage image,
String fontName,
Color color,
int size,
List<ImageOpt.ImageTextInfo> textList) |
static boolean |
addTextToImage(InputStream imageIS,
String imageType,
OutputStream imageOS,
String fontName,
Color color,
int size,
List<ImageOpt.ImageTextInfo> textList) |
static boolean |
addTextToImage(InputStream imageIS,
String imageType,
OutputStream imageOS,
String waterMark,
String fontName,
Color color,
int size,
float x,
float y) |
static void |
captureScreen(String fileName)
抓屏程序 算法来做网络,测试通过
|
static Color |
castObjectToColor(Object obj) |
static Color |
castObjectToColor(Object obj,
Color defaultColor) |
static BufferedImage |
createIdIcon(String id,
int imageSize,
int pointWidth) |
static BufferedImage |
createIdIcon(String id,
int imageSize,
int pointWidth,
boolean singleColor,
boolean symmetric) |
static ImageOpt.ImageTextInfo |
createImageText(float x,
float y,
String t) |
static BufferedImage |
createNameIcon(String word,
int imageSize,
Color wordColor,
boolean withEdge) |
static void |
createThumbnail(String filename,
int thumbWidth,
int thumbHeight,
int quality,
String outFilename)
创建图片的缩略图 ,算法来做网络,测试通过
|
static int[] |
getRGB(BufferedImage image) |
static int[] |
getRGB(BufferedImage image,
int x,
int y,
int width,
int height,
int[] pixels) |
static byte[] |
imageToByteArray(BufferedImage image) |
static byte[] |
imageToByteArray(BufferedImage image,
String formatName) |
static ByteArrayInputStream |
imageToInputStream(BufferedImage image) |
static BufferedImage |
loadImage(String uri)
根据路径图片图片
|
static BufferedImage |
makeRoundBorder(BufferedImage image,
int cornerRadius,
int size,
Color color)
生成圆角图片 圆角边框
|
static BufferedImage |
makeRoundedCorner(BufferedImage image,
int cornerRadius)
生成圆角图片
|
static BufferedImage |
mergeImages(List<BufferedImage> imageList,
int imagesPreRow,
int whiteSpace)
合并图片
|
static void |
saveBufferedImage(String filename,
BufferedImage image,
int quality) |
static BufferedImage |
saveSubImage(BufferedImage image,
Rectangle subImageBounds)
对图像进行 裁剪
|
static List<BufferedImage> |
splitImage(BufferedImage image,
int divisions) |
public static void createThumbnail(String filename, int thumbWidth, int thumbHeight, int quality, String outFilename) throws InterruptedException, IOException
filename - 文件名称thumbWidth - 缩略图宽度thumbHeight - 缩略图高度quality - 缩略图质量outFilename - 输出文件名InterruptedException - 分析异常IOException - IOpublic static void saveBufferedImage(String filename, BufferedImage image, int quality) throws IOException
IOExceptionpublic static void captureScreen(String fileName) throws AWTException, IOException
fileName - 文件名称AWTException - 异常IOException - 异常public static BufferedImage saveSubImage(BufferedImage image, Rectangle subImageBounds)
image - 图片subImageBounds - 图片区域public static List<BufferedImage> splitImage(BufferedImage image, int divisions)
public static BufferedImage mergeImages(List<BufferedImage> imageList, int imagesPreRow, int whiteSpace)
imageList - 这些图片大小需要一致imagesPreRow - 每行几个whiteSpace - 空白占位符public static int[] getRGB(BufferedImage image)
public static int[] getRGB(BufferedImage image, int x, int y, int width, int height, int[] pixels)
public static BufferedImage createIdIcon(String id, int imageSize, int pointWidth, boolean singleColor, boolean symmetric)
public static BufferedImage createIdIcon(String id, int imageSize, int pointWidth)
public static BufferedImage createNameIcon(String word, int imageSize, Color wordColor, boolean withEdge)
public static ByteArrayInputStream imageToInputStream(BufferedImage image) throws IOException
IOExceptionpublic static byte[] imageToByteArray(BufferedImage image) throws IOException
IOExceptionpublic static byte[] imageToByteArray(BufferedImage image, String formatName) throws IOException
IOExceptionpublic static BufferedImage loadImage(String uri) throws IOException
uri - 本地路径 or 网络地址IOException - 异常public static BufferedImage makeRoundedCorner(BufferedImage image, int cornerRadius)
image - 原始图片cornerRadius - 圆角的弧度public static BufferedImage makeRoundBorder(BufferedImage image, int cornerRadius, int size, Color color)
image - 原图cornerRadius - 圆角的角度size - 边框的边距color - 边框的颜色public static ImageOpt.ImageTextInfo createImageText(float x, float y, String t)
public static BufferedImage addTextToImage(BufferedImage image, String fontName, Color color, int size, List<ImageOpt.ImageTextInfo> textList)
public static boolean addTextToImage(InputStream imageIS, String imageType, OutputStream imageOS, String waterMark, String fontName, Color color, int size, float x, float y)
public static boolean addTextToImage(InputStream imageIS, String imageType, OutputStream imageOS, String fontName, Color color, int size, List<ImageOpt.ImageTextInfo> textList)
Copyright © 2025 江苏南大先腾信息产业股份有限公司. All rights reserved.