public class ImgUtil extends Object
| 构造器和说明 |
|---|
ImgUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static BufferedImage |
addRoundedBorder(BufferedImage image,
int radius,
int borderSize,
Color borderColor)
添加圆角边框
|
static void |
coverImage(BufferedImage srcImg,
BufferedImage dstImg,
int widthRatio,
int heightRatio,
Composite composite)
将srcImg叠加到dstImg上
直接修改dstImg
|
static BufferedImage |
fromPathOrUrl(String location)
从path或url读取图片
从网络读取的话,这里是没有显示设置超时时间的,需要注意
|
static BufferedImage |
roundImageCorner(BufferedImage image,
int radius)
将图形圆角化
|
public static void coverImage(BufferedImage srcImg, BufferedImage dstImg, int widthRatio, int heightRatio, Composite composite) throws IOException
srcImg - 源imagedstImg - 目标imagewidthRatio - 宽度比例heightRatio - 高度比例composite - composite类型IOException - 抛出IO异常public static BufferedImage addRoundedBorder(BufferedImage image, int radius, int borderSize, Color borderColor)
image - 源imageradius - 边角弧度borderSize - 边框大小borderColor - 边框颜色public static BufferedImage roundImageCorner(BufferedImage image, int radius)
image - 源imageradius - 圆角的弧度public static BufferedImage fromPathOrUrl(String location) throws IOException
location - 图片地址或网址IOException - 抛出IO异常Copyright © 2017. All rights reserved.