public class ImageUtil extends Object
Copyright (c) 2020 xsx All Rights Reserved. x-easypdf-pdfbox is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.
| 构造器和说明 |
|---|
ImageUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Graphics2D |
createGraphics(BufferedImage image)
创建图形
|
static void |
extract(List<BufferedImage> imageList,
org.apache.pdfbox.pdmodel.PDResources resources)
提取图像
|
static boolean |
isSvgImage(byte[] bytes)
是否svg图像
注:判断是否为xml
|
static BufferedImage |
join(List<BufferedImage> sourceImageList,
boolean isHorizontal)
拼接图片
|
static BufferedImage |
read(byte[] bytes)
读取文件
|
static BufferedImage |
read(File imageFile)
读取文件
|
static BufferedImage |
read(InputStream imageStream)
读取文件
|
static byte[] |
resetBytes(byte[] bytes)
重置图像字节数组
|
static BufferedImage |
rotate(BufferedImage sourceImage,
double radians)
旋转图片
|
static BufferedImage |
scale(BufferedImage sourceImage,
int width,
int height,
int scaleMode)
缩放图片
|
static byte[] |
toBytes(BufferedImage sourceImage,
String imageType)
转为字节数组
|
static InputStream |
toInputStream(BufferedImage sourceImage,
String imageType)
转为字节数组
|
public static BufferedImage read(File imageFile)
imageFile - 图片文件public static BufferedImage read(InputStream imageStream)
imageStream - 图片数据流public static BufferedImage read(byte[] bytes)
bytes - 图片数据流public static BufferedImage scale(BufferedImage sourceImage, int width, int height, int scaleMode)
sourceImage - 源图片width - 缩放宽度height - 缩放高度scaleMode - 缩放模式public static byte[] resetBytes(byte[] bytes)
bytes - 字节数组public static byte[] toBytes(BufferedImage sourceImage, String imageType)
sourceImage - 源图片imageType - 图片类型public static InputStream toInputStream(BufferedImage sourceImage, String imageType)
sourceImage - 源图片imageType - 图片类型public static BufferedImage rotate(BufferedImage sourceImage, double radians)
sourceImage - 源图片radians - 旋转弧度public static BufferedImage join(List<BufferedImage> sourceImageList, boolean isHorizontal)
sourceImageList - 图片列表isHorizontal - 是否水平拼接public static void extract(List<BufferedImage> imageList, org.apache.pdfbox.pdmodel.PDResources resources)
imageList - 待接收图像列表resources - 页面资源public static boolean isSvgImage(byte[] bytes)
注:判断是否为xml
bytes - 字节数组public static Graphics2D createGraphics(BufferedImage image)
image - 图片Copyright © 2024. All rights reserved.